Ssd.pytorch: Running eval.py without GPU

Created on 19 Oct 2018  Â·  3Comments  Â·  Source: amdegroot/ssd.pytorch

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.

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.

All 3 comments

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!.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

oarriaga picture oarriaga  Â·  4Comments

JingpengSun picture JingpengSun  Â·  4Comments

xinyu1214 picture xinyu1214  Â·  5Comments

squirrel16 picture squirrel16  Â·  5Comments

sxyxf66 picture sxyxf66  Â·  4Comments