chrisdxie / uois

MIT License
145 stars 44 forks source link

Issue with setting up Hough_voting_cuda #11

Closed malsaidi93 closed 2 years ago

malsaidi93 commented 3 years ago

Hi Chris,

I am using uois2d branch and I followed the installation steps and I am getting an error when running "python setup.py install"

Environment is activated Using Amazon Linux sagemaker p3.8 instance

The error I'm getting is this :

(uois) [root@ip-172-16-48-121 hough_voting]# python setup.py install
No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda'
running install
running bdist_egg
running egg_info
writing hough_voting.egg-info/PKG-INFO
writing dependency_links to hough_voting.egg-info/dependency_links.txt
writing top-level names to hough_voting.egg-info/top_level.txt
/home/ec2-user/anaconda3/envs/uois/lib/python3.7/site-packages/torch/utils/cpp_extension.py:381: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
  warnings.warn(msg.format('we could not find ninja.'))
reading manifest file 'hough_voting.egg-info/SOURCES.txt'
writing manifest file 'hough_voting.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_ext
Traceback (most recent call last):
  File "setup.py", line 15, in <module>
    'build_ext': BuildExtension
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/site-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/site-packages/setuptools/command/install.py", line 67, in run
    self.do_egg_install()
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/site-packages/setuptools/command/install.py", line 109, in do_egg_install
    self.run_command('bdist_egg')
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 164, in run
    cmd = self.call_command('install_lib', warn_dir=0)
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/site-packages/setuptools/command/bdist_egg.py", line 150, in call_command
    self.run_command(cmdname)
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/site-packages/setuptools/command/install_lib.py", line 11, in run
    self.build()
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/distutils/command/install_lib.py", line 107, in build
    self.run_command('build_ext')
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 79, in run
    _build_ext.run(self)
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/distutils/command/build_ext.py", line 340, in run
    self.build_extensions()
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 404, in build_extensions
    self._check_cuda_version()
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 777, in _check_cuda_version
    torch_cuda_version = packaging.version.parse(torch.version.cuda)
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/version.py", line 56, in parse
    return Version(version)
  File "/home/ec2-user/anaconda3/envs/uois/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/version.py", line 275, in __init__
    match = self._regex.search(version)
TypeError: expected string or bytes-like object
(uois) [root@ip-172-16-48-121 hough_voting]# 

I have tried looking for answers but didn't find any. Hope you can help with this.

chrisdxie commented 2 years ago

Hi,

I am not sure what the cause of this is. However, as mentioned in the README, one tip is to make sure that cudatoolkit in env.yml matches your native CUDA version (under /usr/local/cuda/). This was done because cudatoolkit as installed by anaconda did not come with the CUDA compiler. Nowadays, I believe it does, so an alternative method is to configure it to use the compiler installed with cudatoolkit. Hopefully one of those two options should work.