otaheri / chamfer_distance

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

subprocess.CalledProcessError: Command '['where', 'cl']' returned non-zero exit status 1. #3

Open zc6189 opened 3 years ago

zc6189 commented 3 years ago

there is a problem when running with the pycharm in windows

lileitech commented 3 years ago

there is a problem when running with the pycharm in windows

I met the same problem. Have you solve it?

otaheri commented 2 years ago

Can you point to the specific problem please? What is the error that you receive?

podragonwer commented 2 years ago

I have the same problem:

import chamfer_distance

Traceback (most recent call last): File "", line 1, in File "C:\Users\alienware\anaconda3\envs\torch\lib\site-packages\chamfer_distance__init__.py", line 1, in from .chamfer_distance import ChamferDistance File "C:\Users\alienware\anaconda3\envs\torch\lib\site-packages\chamfer_distance\chamfer_distance.py", line 10, in f_path + '/chamfer_distance.cu']) File "C:\Users\alienware\anaconda3\envs\torch\lib\site-packages\torch\utils\cpp_extension.py", line 1091, in load keep_intermediates=keep_intermediates) File "C:\Users\alienware\anaconda3\envs\torch\lib\site-packages\torch\utils\cpp_extension.py", line 1302, in _jit_compile is_standalone=is_standalone) File "C:\Users\alienware\anaconda3\envs\torch\lib\site-packages\torch\utils\cpp_extension.py", line 1400, in _write_ninja_file_and_build_library is_standalone=is_standalone) File "C:\Users\alienware\anaconda3\envs\torch\lib\site-packages\torch\utils\cpp_extension.py", line 1833, in _write_ninja_file_to_build_library with_cuda=with_cuda) File "C:\Users\alienware\anaconda3\envs\torch\lib\site-packages\torch\utils\cpp_extension.py", line 1948, in _write_ninja_file 'cl']).decode().split('\r\n') File "C:\Users\alienware\anaconda3\envs\torch\lib\subprocess.py", line 376, in check_output **kwargs).stdout File "C:\Users\alienware\anaconda3\envs\torch\lib\subprocess.py", line 468, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['where', 'cl']' returned non-zero exit status 1.

podragonwer commented 2 years ago

then I followed this

import chamfer_distance

Traceback (most recent call last): File "", line 1, in File "C:\Users\alienware\anaconda3\envs\torch\lib\site-packages\chamfer_distance__init__.py", line 1, in from .chamfer_distance import ChamferDistance File "C:\Users\alienware\anaconda3\envs\torch\lib\site-packages\chamfer_distance\chamfer_distance.py", line 10, in f_path + '/chamfer_distance.cu']) File "C:\Users\alienware\anaconda3\envs\torch\lib\site-packages\torch\utils\cpp_extension.py", line 1091, in load keep_intermediates=keep_intermediates) File "C:\Users\alienware\anaconda3\envs\torch\lib\site-packages\torch\utils\cpp_extension.py", line 1317, in _jit_compile return _import_module_from_library(name, build_directory, is_python_module) File "C:\Users\alienware\anaconda3\envs\torch\lib\site-packages\torch\utils\cpp_extension.py", line 1699, in _import_module_from_library file, path, description = imp.find_module(module_name, [path]) File "C:\Users\alienware\anaconda3\envs\torch\lib\imp.py", line 297, in find_module raise ImportError(_ERR_MSG.format(name), name=name) ImportError: No module named 'cd'

I use cuda 11 and llooking at this i think it's a driver prob;lem

lileitech commented 2 years ago

I have the same problem:

import chamfer_distance

Traceback (most recent call last): File "", line 1, in File "C:\Users\alienware\anaconda3\envs\torch\lib\site-packages\chamfer_distanceinit.py", line 1, in from .chamfer_distance import ChamferDistance File "C:\Users\alienware\anaconda3\envs\torch\lib\site-packages\chamfer_distance\chamfer_distance.py", line 10, in f_path + '/chamfer_distance.cu']) File "C:\Users\alienware\anaconda3\envs\torch\lib\site-packages\torch\utils\cpp_extension.py", line 1091, in load keep_intermediates=keep_intermediates) File "C:\Users\alienware\anaconda3\envs\torch\lib\site-packages\torch\utils\cpp_extension.py", line 1302, in _jit_compile is_standalone=is_standalone) File "C:\Users\alienware\anaconda3\envs\torch\lib\site-packages\torch\utils\cpp_extension.py", line 1400, in _write_ninja_file_and_build_library is_standalone=is_standalone) File "C:\Users\alienware\anaconda3\envs\torch\lib\site-packages\torch\utils\cpp_extension.py", line 1833, in _write_ninja_file_to_build_library with_cuda=with_cuda) File "C:\Users\alienware\anaconda3\envs\torch\lib\site-packages\torch\utils\cpp_extension.py", line 1948, in _write_ninja_file 'cl']).decode().split('\r\n') File "C:\Users\alienware\anaconda3\envs\torch\lib\subprocess.py", line 376, in check_output **kwargs).stdout File "C:\Users\alienware\anaconda3\envs\torch\lib\subprocess.py", line 468, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['where', 'cl']' returned non-zero exit status 1.

Hi,

I think maybe this package can not use in windows system. Currently, I am using it in Linux system, and no errors have been reported. Therefore, I recommend you try it on linux system.

Hope this information can be helpful.

otaheri commented 2 years ago

I could solve the issues by reinstalling the python dependencies with the commands below. Hopefully it will work for you too. Please let me know if this still doesn't work.

sudo apt install libpython3.X-dev ## replace X with your python version
sudo apt-get install python3-dev
sudo apt-get install python-dev

## GCC version should be equal or lower than 7, replace X with your version
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-X 10 
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-X 10 
## 10 is the priority, you can set it to any other number, but it should be higher than other gcc/g++ versions

sudo apt-get install --reinstall build-essential