I want to run eval.py with CPU no GPU(cuda).
So I change argument, --cuda default value from true to False.
But it doesn't work.
And I got this error. Loot at below :
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.
Please give me solution.
For 425 lines in eval.py, May me you can correct the code ‘net.load_state_dict(torch.load(args.trained_model))’ to ‘net.load_state_dict(torch.load(args.trained_model, 'cpu'))’ .
It works for me.
Thanks! it works.
@MakeToast
Can I ask the reason you want to eval on cpu??
In my case, I tried to eval every 100 iteration on cpu while It train on GPU!.
But eval code only evaluate last VOC.path(last trained one). So I trying to solve this problem.
If it is not your mean, never mind!.
Most helpful comment
For 425 lines in eval.py, May me you can correct the code ‘net.load_state_dict(torch.load(args.trained_model))’ to ‘net.load_state_dict(torch.load(args.trained_model, 'cpu'))’ .
It works for me.