xiawj-hub / CTLIB

A lib of CT projector and back-projector based on PyTorch
MIT License
39 stars 6 forks source link

Install Error #4

Closed chrisdcs closed 1 year ago

chrisdcs commented 2 years ago

Hi, I tried follow strictly the environment you provided, but it keeps giving me errors like this both in Windows and Linux, can you help me with the installation. I tried StackOverflow, but there is no solution I can find. Thank you very much.

Traceback (most recent call last):

  File ~\anaconda3\envs\CT\lib\site-packages\torch\utils\cpp_extension.py:1667 in _run_ninja_build
    subprocess.run(

  File ~\anaconda3\envs\CT\lib\subprocess.py:516 in run
    raise CalledProcessError(retcode, process.args,

CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

  File E:\research\sparse_view_ct-main\projection_simulatuion\CTLIB\setup.py:4 in <module>
    setup(

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\__init__.py:87 in setup
    return distutils.core.setup(**attrs)

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\_distutils\core.py:148 in setup
    return run_commands(dist)

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\_distutils\core.py:163 in run_commands
    dist.run_commands()

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\_distutils\dist.py:967 in run_commands
    self.run_command(cmd)

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\dist.py:1214 in run_command
    super().run_command(command)

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\_distutils\dist.py:986 in run_command
    cmd_obj.run()

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\command\install.py:74 in run
    self.do_egg_install()

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\command\install.py:123 in do_egg_install
    self.run_command('bdist_egg')

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\_distutils\cmd.py:313 in run_command
    self.distribution.run_command(command)

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\dist.py:1214 in run_command
    super().run_command(command)

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\_distutils\dist.py:986 in run_command
    cmd_obj.run()

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\command\bdist_egg.py:165 in run
    cmd = self.call_command('install_lib', warn_dir=0)

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\command\bdist_egg.py:151 in call_command
    self.run_command(cmdname)

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\_distutils\cmd.py:313 in run_command
    self.distribution.run_command(command)

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\dist.py:1214 in run_command
    super().run_command(command)

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\_distutils\dist.py:986 in run_command
    cmd_obj.run()

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\command\install_lib.py:11 in run
    self.build()

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\_distutils\command\install_lib.py:107 in build
    self.run_command('build_ext')

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\_distutils\cmd.py:313 in run_command
    self.distribution.run_command(command)

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\dist.py:1214 in run_command
    super().run_command(command)

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\_distutils\dist.py:986 in run_command
    cmd_obj.run()

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\command\build_ext.py:79 in run
    _build_ext.run(self)

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\_distutils\command\build_ext.py:339 in run
    self.build_extensions()

  File ~\anaconda3\envs\CT\lib\site-packages\torch\utils\cpp_extension.py:708 in build_extensions
    build_ext.build_extensions(self)

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\_distutils\command\build_ext.py:448 in build_extensions
    self._build_extensions_serial()

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\_distutils\command\build_ext.py:473 in _build_extensions_serial
    self.build_extension(ext)

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\command\build_ext.py:202 in build_extension
    _build_ext.build_extension(self, ext)

  File ~\anaconda3\envs\CT\lib\site-packages\setuptools\_distutils\command\build_ext.py:528 in build_extension
    objects = self.compiler.compile(sources,

  File ~\anaconda3\envs\CT\lib\site-packages\torch\utils\cpp_extension.py:681 in win_wrap_ninja_compile
    _write_ninja_file_and_compile_objects(

  File ~\anaconda3\envs\CT\lib\site-packages\torch\utils\cpp_extension.py:1354 in _write_ninja_file_and_compile_objects
    _run_ninja_build(

  File ~\anaconda3\envs\CT\lib\site-packages\torch\utils\cpp_extension.py:1683 in _run_ninja_build
    raise RuntimeError(message) from e

RuntimeError: Error compiling objects for extension
xiawj-hub commented 2 years ago

Hi

I have never met this error, so I don't have constructive suggestions. But I found a similar problem. https://github.com/facebookresearch/maskrcnn-benchmark/issues/1236 It is said that it seems caused by the pytorch version. Please tell me your compiling environment.

Best, Wenjun

Chi D. @.***> 于2022年6月8日周三 02:14写道:

Hi, I tried follow strictly the environment you provided, but it keeps giving me errors like this both in Windows and Linux, can you help me with the installation. I tried StackOverflow, but there is no solution I can find. Thank you very much.

Traceback (most recent call last):

File ~\anaconda3\envs\CT\lib\site-packages\torch\utils\cpp_extension.py:1667 in _run_ninja_build subprocess.run(

File ~\anaconda3\envs\CT\lib\subprocess.py:516 in run raise CalledProcessError(retcode, process.args,

CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

File E:\research\sparse_view_ct-main\projection_simulatuion\CTLIB\setup.py:4 in setup(

File ~\anaconda3\envs\CT\lib\site-packages\setuptools__init__.py:87 in setup return distutils.core.setup(**attrs)

File ~\anaconda3\envs\CT\lib\site-packages\setuptools_distutils\core.py:148 in setup return run_commands(dist)

File ~\anaconda3\envs\CT\lib\site-packages\setuptools_distutils\core.py:163 in run_commands dist.run_commands()

File ~\anaconda3\envs\CT\lib\site-packages\setuptools_distutils\dist.py:967 in run_commands self.run_command(cmd)

File ~\anaconda3\envs\CT\lib\site-packages\setuptools\dist.py:1214 in run_command super().run_command(command)

File ~\anaconda3\envs\CT\lib\site-packages\setuptools_distutils\dist.py:986 in run_command cmd_obj.run()

File ~\anaconda3\envs\CT\lib\site-packages\setuptools\command\install.py:74 in run self.do_egg_install()

File ~\anaconda3\envs\CT\lib\site-packages\setuptools\command\install.py:123 in do_egg_install self.run_command('bdist_egg')

File ~\anaconda3\envs\CT\lib\site-packages\setuptools_distutils\cmd.py:313 in run_command self.distribution.run_command(command)

File ~\anaconda3\envs\CT\lib\site-packages\setuptools\dist.py:1214 in run_command super().run_command(command)

File ~\anaconda3\envs\CT\lib\site-packages\setuptools_distutils\dist.py:986 in run_command cmd_obj.run()

File ~\anaconda3\envs\CT\lib\site-packages\setuptools\command\bdist_egg.py:165 in run cmd = self.call_command('install_lib', warn_dir=0)

File ~\anaconda3\envs\CT\lib\site-packages\setuptools\command\bdist_egg.py:151 in call_command self.run_command(cmdname)

File ~\anaconda3\envs\CT\lib\site-packages\setuptools_distutils\cmd.py:313 in run_command self.distribution.run_command(command)

File ~\anaconda3\envs\CT\lib\site-packages\setuptools\dist.py:1214 in run_command super().run_command(command)

File ~\anaconda3\envs\CT\lib\site-packages\setuptools_distutils\dist.py:986 in run_command cmd_obj.run()

File ~\anaconda3\envs\CT\lib\site-packages\setuptools\command\install_lib.py:11 in run self.build()

File ~\anaconda3\envs\CT\lib\site-packages\setuptools_distutils\command\install_lib.py:107 in build self.run_command('build_ext')

File ~\anaconda3\envs\CT\lib\site-packages\setuptools_distutils\cmd.py:313 in run_command self.distribution.run_command(command)

File ~\anaconda3\envs\CT\lib\site-packages\setuptools\dist.py:1214 in run_command super().run_command(command)

File ~\anaconda3\envs\CT\lib\site-packages\setuptools_distutils\dist.py:986 in run_command cmd_obj.run()

File ~\anaconda3\envs\CT\lib\site-packages\setuptools\command\build_ext.py:79 in run _build_ext.run(self)

File ~\anaconda3\envs\CT\lib\site-packages\setuptools_distutils\command\build_ext.py:339 in run self.build_extensions()

File ~\anaconda3\envs\CT\lib\site-packages\torch\utils\cpp_extension.py:708 in build_extensions build_ext.build_extensions(self)

File ~\anaconda3\envs\CT\lib\site-packages\setuptools_distutils\command\build_ext.py:448 in build_extensions self._build_extensions_serial()

File ~\anaconda3\envs\CT\lib\site-packages\setuptools_distutils\command\build_ext.py:473 in _build_extensions_serial self.build_extension(ext)

File ~\anaconda3\envs\CT\lib\site-packages\setuptools\command\build_ext.py:202 in build_extension _build_ext.build_extension(self, ext)

File ~\anaconda3\envs\CT\lib\site-packages\setuptools_distutils\command\build_ext.py:528 in build_extension objects = self.compiler.compile(sources,

File ~\anaconda3\envs\CT\lib\site-packages\torch\utils\cpp_extension.py:681 in win_wrap_ninja_compile _write_ninja_file_and_compile_objects(

File ~\anaconda3\envs\CT\lib\site-packages\torch\utils\cpp_extension.py:1354 in _write_ninja_file_and_compile_objects _run_ninja_build(

File ~\anaconda3\envs\CT\lib\site-packages\torch\utils\cpp_extension.py:1683 in _run_ninja_build raise RuntimeError(message) from e

RuntimeError: Error compiling objects for extension

— Reply to this email directly, view it on GitHub https://github.com/xwj01/CTLIB/issues/4, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJRVWQOZIQJZHK2UJILLS5TVN6GQJANCNFSM5YD2W5RA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

chrisdcs commented 2 years ago

Thank you very much for the help. My windows environment is cuda 10.2, torch 1.8.0 (> 1.7.0). Now I managed to install it in Ubuntu 20.04, cuda 11.3, torch 1.10.0

But still can't install it on Windows, I can try to read the blog you sent me, but can you give me some general instructions on how to trouble shoot these issues so that I can try to solve it by myself?

Thank you very much!

xiawj-hub commented 1 year ago

Very strange. My windows environment is cuda 10.2, torch. 1.10, I can compile the code, but I've never tried torch 1.8. Is your cuda installed with conda? My friends failed compiling with cuda installed with conda. But I don't remember if your error reports are the same. Now my only suggestion is to upgrade torch, but I don't know if it will work.

Best, Wenjun

Chi D. @.***> 于2022年6月11日周六 05:27写道:

Thank you very much for the help. My windows environment is cuda 10.2, torch 1.8.0 (> 1.7.0). Now I managed to install it in Ubuntu 20.04, cuda 11.3, torch 1.10.0

But still can't install it on Windows, I can try to read the blog you sent me, but can you give me some general instructions on how to trouble shoot these issues so that I can try to solve it by myself?

Thank you very much!

— Reply to this email directly, view it on GitHub https://github.com/xwj01/CTLIB/issues/4#issuecomment-1152750050, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJRVWQP2RTY4YYC3ZZ6AN73VOOXMXANCNFSM5YD2W5RA . You are receiving this because you commented.Message ID: @.***>

zlbbme commented 1 year ago

Thank you very much for the help. My windows environment is cuda 10.2, torch 1.8.0 (> 1.7.0). Now I managed to install it in Ubuntu 20.04, cuda 11.3, torch 1.10.0

But still can't install it on Windows, I can try to read the blog you sent me, but can you give me some general instructions on how to trouble shoot these issues so that I can try to solve it by myself?

Thank you very much!

Thank you very much for the help. My windows environment is cuda 10.2, torch 1.8.0 (> 1.7.0). Now I managed to install it in Ubuntu 20.04, cuda 11.3, torch 1.10.0

But still can't install it on Windows, I can try to read the blog you sent me, but can you give me some general instructions on how to trouble shoot these issues so that I can try to solve it by myself?

Thank you very much!

Do you solve the question? I got the same question,My environment is cuda 11.1,torch1.8

chrisdcs commented 1 year ago

Yes, I solved it, I think upgrading Pytorch to 1.10 worked. But I am not sure if it's that simple. It also has something to do with ninja compatibility with Pytorch. It's been a while so I don't remember all the details, wish I could help more, good luck!

zlbbme commented 1 year ago

Thanks for your reply,I update my pytorch vesion to 1.10.1,and i code "python setup.py install" ,then I got this error: command '/usr/local/cuda/bin/nvcc' failed with exit code 1;so I'm very confused. looking forward to your reply

xiawj-hub commented 1 year ago

I need more error information. You can press ctrl+f in the terminal to look for the error information.

From: zlbbme @.> Sent: Friday, December 30, 2022 2:16 AM To: xwj01/CTLIB @.> Cc: xwj01 @.>; Comment @.> Subject: Re: [xwj01/CTLIB] Install Error (Issue #4)

Thanks for your reply,I update my pytorch vesion to 1.10.1,and i code "python setup.py install" ,then I got this error: command '/usr/local/cuda/bin/nvcc' failed with exit code 1;so I'm very confused. looking forward to your reply

— Reply to this email directly, view it on GitHub https://github.com/xwj01/CTLIB/issues/4#issuecomment-1367763649 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AJRVWQNLBHJE2NLFSEOXIL3WP2DZTANCNFSM5YD2W5RA . You are receiving this because you commented. https://github.com/notifications/beacon/AJRVWQN23BF5AXLYSIVDB23WP2DZTA5CNFSM5YD2W5RKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOKGDGVQI.gif Message ID: @. @.> >

chrisdcs commented 1 year ago

That's odd, I just did two tests recently, and I can install it with PyTorch 1.10 + Cuda 11.3 and Pytorch 1.13 + Cuda 11.6 with new clean conda environments. Maybe it has something to do with your Cuda and GCC versions? All these are linux, I could never install it in my windows system.

zlbbme commented 1 year ago

Thanks for your reply,I apply the method of Dr.xwj and I completed the ctlib install finally. I also install the ctlib with pytorch 1.13+cuda 11.6,but I am confused with this situation: I code python setup.py install ,then the terminal shows : "Installed /home/zlb/anaconda3/lib/python3.9/site-packages/ctlib-0.2.0-py3.9-linux-x86_64.egg Processing dependencies for ctlib==0.2.0 Finished processing dependencies for ctlib==0.2.0" I think that I haved installed ctlib ; but I code "import ctlib" ,then the interpreter reply me with this error: "libc10.so: cannot open shared object file: No such file or directory"

So, I don't know how to solve this question,thanks.

zlbbme commented 1 year ago

sorry, I am very fool. import ctlib before, we must import torch