poppinace / indexnet_matting

(ICCV'19) Indices Matter: Learning to Index for Deep Image Matting
Other
389 stars 90 forks source link

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

Closed leijue222 closed 4 years ago

leijue222 commented 4 years ago

Question: when I run demo.py https://github.com/poppinace/indexnet_matting/blob/867720dee1bc74212ec77bf2ad1c43af3bbc1c8f/scripts/demo.py#L45 Error will be reported when loading the model. Snipast11 Reason The relative path of pretrained and example is wrong.

leijue222 commented 4 years ago

My GPU is GTX 950M. The memory is too small and needs to be switched to the CPU to predict. https://github.com/poppinace/indexnet_matting/blob/867720dee1bc74212ec77bf2ad1c43af3bbc1c8f/scripts/demo.py#L45 change to: checkpoint = torch.load(RESTORE_FROM, map_location='cpu') https://github.com/poppinace/indexnet_matting/blob/867720dee1bc74212ec77bf2ad1c43af3bbc1c8f/scripts/demo.py#L91 change to: inputs = inputs.cpu()