Closed bryanbocao closed 2 years ago
Tried to run
CUDA_VISIBLE_DEVICES='' python prune_resnet18_cifar10.py --mode test --round 1 --total_epochs 1 --step_size 1
on cpu
https://github.com/VainF/Torch-Pruning/blob/master/examples/cifar_minimal/run.sh
but got
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=torch.device('cpu') to map your storages to the CPU.
Add argument
map_location=torch.device('cpu')
in load()
model = torch.load(previous_ckpt, map_location=torch.device('cpu'))
Tried to run
on cpu
but got