microsoft / RegionCLIP

[CVPR 2022] Official code for "RegionCLIP: Region-based Language-Image Pretraining"
Apache License 2.0
712 stars 52 forks source link

setup issue #60

Closed ziqingcheryl closed 1 year ago

ziqingcheryl commented 1 year ago

I hit the following error when installing. I strictly follow the install.md file but it doesn't seem to work. The cuda version is 11.3

Obtaining file:///media/data2/ziqing/RegionCLIP Preparing metadata (setup.py) ... error error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [28 lines of output] No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda' /home/ziqing/miniconda3/envs/regionclip/lib/python3.9/site-packages/setuptools/dist.py:543: UserWarning: The version specified ('RegionCLIP') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details. warnings.warn( running egg_info Traceback (most recent call last): File "", line 2, in File "", line 34, in File "/media/data2/ziqing/actiondetection/RegionCLIP/setup.py", line 193, in setup( File "/home/ziqing/miniconda3/envs/regionclip/lib/python3.9/site-packages/setuptools/init.py", line 87, in setup return distutils.core.setup(**attrs) File "/home/ziqing/miniconda3/envs/regionclip/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup return run_commands(dist) File "/home/ziqing/miniconda3/envs/regionclip/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands dist.run_commands() File "/home/ziqing/miniconda3/envs/regionclip/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands self.run_command(cmd) File "/home/ziqing/miniconda3/envs/regionclip/lib/python3.9/site-packages/setuptools/dist.py", line 1208, in run_command super().run_command(command) File "/home/ziqing/miniconda3/envs/regionclip/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 987, in run_command cmd_obj.ensure_finalized() File "/home/ziqing/miniconda3/envs/regionclip/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized self.finalize_options() File "/home/ziqing/miniconda3/envs/regionclip/lib/python3.9/site-packages/setuptools/command/egg_info.py", line 219, in finalize_options parsed_version = parse_version(self.egg_version) File "/home/ziqing/miniconda3/envs/regionclip/lib/python3.9/site-packages/pkg_resources/_vendor/packaging/version.py", line 266, in init raise InvalidVersion(f"Invalid version: '{version}'") pkg_resources.extern.packaging.version.InvalidVersion: Invalid version: 'RegionCLIP' [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed

× Encountered error while generating package metadata. ╰─> See above for output.

note: This is an issue with the package mentioned above, not pip. hint: See above for details.

RuoyuChen10 commented 1 year ago

I hit the following error when installing. I strictly follow the install.md file but it doesn't seem to work. The cuda version is 11.3

Obtaining file:///media/data2/ziqing/RegionCLIP Preparing metadata (setup.py) ... error error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [28 lines of output] No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda' /home/ziqing/miniconda3/envs/regionclip/lib/python3.9/site-packages/setuptools/dist.py:543: UserWarning: The version specified ('RegionCLIP') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details. warnings.warn( running egg_info Traceback (most recent call last): File "", line 2, in File "", line 34, in File "/media/data2/ziqing/actiondetection/RegionCLIP/setup.py", line 193, in setup( File "/home/ziqing/miniconda3/envs/regionclip/lib/python3.9/site-packages/setuptools/init.py", line 87, in setup return distutils.core.setup(attrs) File "/home/ziqing/miniconda3/envs/regionclip/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup return run_commands(dist) File "/home/ziqing/miniconda3/envs/regionclip/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands dist.run_commands() File "/home/ziqing/miniconda3/envs/regionclip/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands self.run_command(cmd) File "/home/ziqing/miniconda3/envs/regionclip/lib/python3.9/site-packages/setuptools/dist.py", line 1208, in run_command super().run_command(command) File "/home/ziqing/miniconda3/envs/regionclip/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 987, in run_command cmd_obj.ensure_finalized() File "/home/ziqing/miniconda3/envs/regionclip/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized self.finalize_options() File "/home/ziqing/miniconda3/envs/regionclip/lib/python3.9/site-packages/setuptools/command/egg_info.py", line 219, in finalize_options parsed_version = parse_version(self.egg_version) File "/home/ziqing/miniconda3/envs/regionclip/lib/python3.9/site-packages/pkg_resources/_vendor/packaging/version.py", line 266, in init** raise InvalidVersion(f"Invalid version: '{version}'") pkg_resources.extern.packaging.version.InvalidVersion: Invalid version: 'RegionCLIP' [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed

× Encountered error while generating package metadata. ╰─> See above for output.

note: This is an issue with the package mentioned above, not pip. hint: See above for details.

I meet it too, and I solved it by downgrade the version of setuptools:

pip install setuptools==59
Taoww21480 commented 1 year ago

Thank you for RuoyuChen10's answer. I tested on Google Collab today and encountered a similar issue. The solution is to lower the version of setuptools, which is version 59.0.1!

pip install setuptools==59.0.1

jayambe36 commented 1 year ago

It looks like the error is related to the package metadata, and specifically the version specified in the setup.py file. The error message indicates that the version specified ('RegionCLIP') is not a valid version according to PEP 440.

To fix this issue, you should update the version specified in the setup.py file to a valid version string that conforms to the PEP 440 specification. This should resolve the error and allow you to install the package successfully.

For example, you could update the setup.py file to specify a version number like this:

arduino

setup( name='RegionCLIP', version='0.1.0', ... )

This specifies a version number of '0.1.0', which is a valid version string according to PEP 440. You should replace '0.1.0' with the appropriate version number for your package.

Once you have updated the version string in the setup.py file, you can try running the installation command again and see if the issue is resolved.

Taoww21480 commented 1 year ago

Thank you very much for your email. I will try to solve it. If there are any other issues, can I contact you via email? I am very interested in understanding the code for your project RegionClip and would like to try to reproduce it.

------------------ 原始邮件 ------------------ 发件人: "Smit R. @.>; 发送时间: 2023年5月10日(星期三) 凌晨0:56 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [microsoft/RegionCLIP] setup issue (Issue #60)

It looks like the error is related to the package metadata, and specifically the version specified in the setup.py file. The error message indicates that the version specified ('RegionCLIP') is not a valid version according to PEP 440.

To fix this issue, you should update the version specified in the setup.py file to a valid version string that conforms to the PEP 440 specification. This should resolve the error and allow you to install the package successfully.

For example, you could update the setup.py file to specify a version number like this:

arduino

setup( name='RegionCLIP', version='0.1.0', ... )

This specifies a version number of '0.1.0', which is a valid version string according to PEP 440. You should replace '0.1.0' with the appropriate version number for your package.

Once you have updated the version string in the setup.py file, you can try running the installation command again and see if the issue is resolved.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>