otaheri / chamfer_distance

Implementation of the Chamfer Distance as a module for PyTorch
MIT License
166 stars 20 forks source link

ImportError: No module named 'cd' #2

Open QiNing-07 opened 3 years ago

QiNing-07 commented 3 years ago

I install pytorch and chamfer_distance, but when I run the Usage, the error is ' ImportError: No module named 'cd' ', my python is 3.6 and pytorch is 1.7 .

QiNing-07 commented 3 years ago

I debug chamfer_distance.py and find there is something missed. 2021-06-23 10-25-36屏幕截图 2021-07-02 11-32-34屏幕截图 I have only on 'cd' folder

otaheri commented 3 years ago

Hi @QiNing-07 , please take a look at the previous issue on this here. There you find a link to a collab notebook that I prepared and it works for other python and PyTorch versions.

QiNing-07 commented 3 years ago

Hi @QiNing-07 , please take a look at the previous issue on this here. There you find a link to a collab notebook that I prepared and it works for other python and PyTorch versions.

Hi @otaheri ,I have looked at the previous issue, but I run in Pycharm and it dose not work. It is so strange.

otaheri commented 2 years ago

Please try the solution here if you still face the issue.

xqZhang-Strong commented 2 years ago

I also comed to the error,and i just solved it by building cd with ninja. Concrete steps are as follows:

  1. I open the folder: /home/zxq/.cache/torch_extensions/cd/, there is a file named"build.ninja",and a line "ninja_required_version = 1.3" in it.
  2. Then i check my ninja version, and it is 1.8.2, so i uninstall it and download 1.3.0 from https://github.com/ninja-build/ninja/releases?page=2. Then I decompress it and come to its folder,
build ninja
$ ./bootstrap.py
then a file named "ninja" is generated at current directory
copy it to system directory, I use it in conda ,so copy it to env directory. if use it in system, you can change with "/usr/bin"
$ cp ninja /home/zxq/.conda/envs/pytorch-1.7/bin
check if ninja is installed successfully or not
$ ninja --version
  1. build project with ninja
$ cd /home/zxq/.cache/torch_extensions/py36_cu102/cd
$ ninja

Now, all is ok. We can try by execute test file.

I think the key is to find where the cd.so corresponding to your cuda should be, and generate it manually.

ptxaxx commented 2 years ago

I also comed to the error,and i just solved it by building cd with ninja. Concrete steps are as follows:

  1. I open the folder: /home/zxq/.cache/torch_extensions/cd/, there is a file named"build.ninja",and a line "ninja_required_version = 1.3" in it.
  2. Then i check my ninja version, and it is 1.8.2, so i uninstall it and download 1.3.0 from https://github.com/ninja-build/ninja/releases?page=2. Then I decompress it and come to its folder,
build ninja
$ ./bootstrap.py
then a file named "ninja" is generated at current directory
copy it to system directory, I use it in conda ,so copy it to env directory. if use it in system, you can change with "/usr/bin"
$ cp ninja /home/zxq/.conda/envs/pytorch-1.7/bin
check if ninja is installed successfully or not
$ ninja --version
  1. build project with ninja
$ cd /home/zxq/.cache/torch_extensions/py36_cu102/cd
$ ninja

Now, all is ok. We can try by execute test file.

I think the key is to find where the cd.so corresponding to your cuda should be, and generate it manually.

HI! I do not find this folder: .cache/torch_extensions/py36_cu102/cd
where should i find it?thank you