LikeLy-Journey/SegmenTron

Running error on CPU

cmdbug opened this issue · 0 comments

RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False.
If you are running on a CPU-only machine, please use torch.load with map_location='cpu' to map your storages to the CPU.
fix: model_zoo.py
add: map_location=cpu or cuda
torch.load(cfg.TRAIN.PRETRAINED_MODEL_PATH, map_location=torch.device(cfg.DEVICE))