RasmusRPaulsen/Deep-MVLM

NotImplementedError: cannot instantiate 'WindowsPath' on your system

shashikula opened this issue ยท 10 comments

When I try to run this code on an AWS SageMaker notebook instance:
python predict.py --c configs/DTU3D-RGB.json --n assets/testmeshA.obj

I run in to the following error:
Processing assets/testmeshA.obj
Initialising model
Loading checkpoint
Getting device
Warning: There's no GPU available on this machine,prediction will be performed on CPU.
Loading checkpoint: https://shapeml.compute.dtu.dk/Deep-MVLM/models/MVLMModel_DTU3D_RGB_07092019-c1cc3d59.pth
Traceback (most recent call last):
File "predict.py", line 70, in
main(global_config)
File "predict.py", line 51, in main
process_one_file(config, name)
File "predict.py", line 12, in process_one_file
dm = deepmvlm.DeepMVLM(config)
File "/home/ec2-user/SageMaker/Deep-MVLM/deepmvlm/api.py", line 37, in init
self.device, self.model = self._get_device_and_load_model_from_url()
File "/home/ec2-user/SageMaker/Deep-MVLM/deepmvlm/api.py", line 75, in _get_device_and_load_model_from_url
checkpoint = load_url(check_point_name, model_dir, map_location=device)
File "/home/ec2-user/anaconda3/envs/pytorch_p36/lib/python3.6/site-packages/torch/hub.py", line 506, in load_state_dict_from_url
return torch.load(cached_file, map_location=map_location)
File "/home/ec2-user/anaconda3/envs/pytorch_p36/lib/python3.6/site-packages/torch/serialization.py", line 529, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "/home/ec2-user/anaconda3/envs/pytorch_p36/lib/python3.6/site-packages/torch/serialization.py", line 702, in _legacy_load
result = unpickler.load()
File "/home/ec2-user/anaconda3/envs/pytorch_p36/lib/python3.6/pathlib.py", line 1002, in new
% (cls.name,))
NotImplementedError: cannot instantiate 'WindowsPath' on your system

Did you figure it out @shashikula , i am also running same error while running it on google colab?
thanks,
Satyam.

Hi, man

Have you solved it, I meet the same problem, I gauss that it because that we use ubuntu.

I will have a look at the issue next week.
Best,
Rasmus

Hi, man

Have you solved it, I meet the same problem, I gauss that it because that we use ubuntu.

Yup, it's because of operating system, I tried replacing the pathlib functions of windows to ubuntu, but didn't work either!

Are you implementing it on google colab?

Please, let me know, if you're able to run it, successfully,

Thanks โœŒ๐Ÿป

I will have a look at the issue next week.
Best,
Rasmus

Thanks Rasmus, looking forward towards it ๐Ÿ™‚

raise NotImplementedError("cannot instantiate %r on your system"
NotImplementedError: cannot instantiate 'WindowsPath' on your system

Yes, this issue is still open and I had no time to solve it. The problem is that the models are trained on windows and unfortunately some windows paths are stored as part of the saved models.

I hope you fix it soon ๐Ÿ˜ฅ๐Ÿ’ป
I would be grateful ๐Ÿ™‚

I have now tried to fix the issue with the WindowsPath. Could you please try to update the code and see if it works?

I have now tried to fix the issue with the WindowsPath. Could you please try to update the code and see if it works?

it is perfect, thanks a lot