Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct the relative path and switch to the CPU. #18

Closed
leijue222 opened this issue Mar 20, 2020 · 1 comment
Closed

Correct the relative path and switch to the CPU. #18

leijue222 opened this issue Mar 20, 2020 · 1 comment

Comments

@leijue222
Copy link

leijue222 commented Mar 20, 2020

Question:
when I run demo.py

checkpoint = torch.load(RESTORE_FROM)

Error will be reported when loading the model.
Snipast11
Reason
The relative path of pretrained and example is wrong.

@leijue222
Copy link
Author

leijue222 commented Mar 20, 2020

My GPU is GTX 950M.
The memory is too small and needs to be switched to the CPU to predict.

checkpoint = torch.load(RESTORE_FROM)

change to:
checkpoint = torch.load(RESTORE_FROM, map_location='cpu')
inputs = inputs.cuda()

change to:
inputs = inputs.cpu()

@leijue222 leijue222 changed the title Does pretrained model broken? Correct the relative path and switch to the CPU. Mar 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant