nv-tlabs / NKSR

[CVPR 2023 Highlight] Neural Kernel Surface Reconstruction
https://research.nvidia.com/labs/toronto-ai/NKSR
Other
747 stars 43 forks source link

AttributeError: module 'nksr' has no attribute 'Reconstructor' #22

Closed jeremycp3 closed 1 year ago

jeremycp3 commented 1 year ago

感谢您分享的代码。按照您的指南配置好环境后,在运行demo的时候碰到以下报错,该如何解决呢?

(nksr) root@amax:/data202/xyl/NKSR-public/examples# python recons_simple.py [07-05 14:51:19] WARNING Customized build of Open3D is not detected, to resolve this you can do: o3d.py:20 (recommended, using customized Open3D that enables view sync, animation, ...)

                      pip install python-pycg -f https://pycg.s3.ap-northeast-1.amazonaws.com/packages/index.html

             WARNING  Failed to obtain monitor info!                                                                                                                    vis.py:41

Traceback (most recent call last): File "/data202/xyl/NKSR-public/examples/recons_simple.py", line 25, in reconstructor = nksr.Reconstructor(device) AttributeError: module 'nksr' has no attribute 'Reconstructor'

jeremycp3 commented 1 year ago

My torch version is 2.0.0 and CUDA version is 11.8

jeremycp3 commented 1 year ago

I guess there was a problem with pip install nksr:

WARNING: Skipping page https://nksr.huangjh.tech/whl/torch-2.0.0+cu118.html because the GET request got Content-Type: Unknown. The only supported Content-Types are application/vnd.pypi.simple.v1+json, application/vnd.pypi.simple.v1+html, and text/html

But I don't find how to fix it, can you give me some advice?

heiwang1997 commented 1 year ago

Hey, thanks for sharing the question. I have never met this problem before in my previous tests. My guess is that my website is blocked by GFW somehow. Could you please try the alternative link via:

pip install -U pip
pip install -U nksr -f https://nksr.s3.ap-northeast-1.amazonaws.com/whl/torch-2.0.0%2Bcu118.html
jeremycp3 commented 1 year ago

Thanks for your reply! It works, but a new error comes out.

Traceback (most recent call last): File "/data202/xyl/NKSR-public/examples/recons_simple.py", line 25, in reconstructor = nksr.Reconstructor(device) File "/root/anaconda3/envs/nksr/lib/python3.10/site-packages/nksr/init.py", line 140, in init ckpt_data = load_checkpoint_from_url(self.hparams.url) File "/root/anaconda3/envs/nksr/lib/python3.10/site-packages/nksr/configs.py", line 83, in load_checkpoint_from_url return torch.hub.load_state_dict_from_url(url) File "/root/anaconda3/envs/nksr/lib/python3.10/site-packages/torch/hub.py", line 750, in load_state_dict_from_url return torch.load(cached_file, map_location=map_location) File "/root/anaconda3/envs/nksr/lib/python3.10/site-packages/torch/serialization.py", line 815, in load return _legacy_load(opened_file, map_location, pickle_module, pickle_load_args) File "/root/anaconda3/envs/nksr/lib/python3.10/site-packages/torch/serialization.py", line 1033, in _legacy_load magic_number = pickle_module.load(f, pickle_load_args) _pickle.UnpicklingError: invalid load key, '<'.

jeremycp3 commented 1 year ago

I fixed it. The checkpoint was not downloaded well. That's the reason.

heiwang1997 commented 1 year ago

Nice! Glad it helps!