chamfer_distance icon indicating copy to clipboard operation
chamfer_distance copied to clipboard

ImportError: No module named 'cd'

Open QiNing-07 opened this issue 3 years ago • 6 comments

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 avatar Jul 01 '21 02:07 QiNing-07

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

QiNing-07 avatar Jul 02 '21 06:07 QiNing-07

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.

otaheri avatar Jul 02 '21 10:07 otaheri

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.

QiNing-07 avatar Jul 03 '21 04:07 QiNing-07

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

otaheri avatar May 05 '22 14:05 otaheri

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.

xqZhang-Strong avatar Jun 02 '22 07:06 xqZhang-Strong

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

ptxaxx avatar Jul 25 '22 07:07 ptxaxx