movienet / movienet-tools

Tools for movie and video research
http://movienet.github.io
276 stars 32 forks source link

cannot import name 'nms_cpu' from partially initialized module 'movienet.tools.detector.persondet.modules.core.ops.nms' (most likely due to a circular import) #33

Open 1933874502 opened 2 years ago

1933874502 commented 2 years ago

need a solution

yenvu93 commented 2 years ago

Using git clone https://github.com/movienet/movienet-tools.git and run python setup.py develop The problem will be solved. It seems that due to not being able to get git, it doesn't build the nms_cpu object which is a c++ file before importing it into the python file.

1933874502 commented 2 years ago

Thanks for answering.I did what you said,but this came out. what is the reason?

EXT_TYPE pytorch EXT_MODULE_LIST [<setuptools.extension.Extension('movienet.tools.detector.persondet.modules.core.ops.nms.soft_nms_cpu') at 0x257c4206ec0>, <setuptools.extension.Extension('movienet.tools.detector.persondet.modules.core.ops.nms.nms_cpu') at 0x257c40fe770>, <setuptools.extension.Extension('movienet.tools.detector.persondet.modules.core.ops.nms.nms_cuda') at 0x257c40fe6b0>, <setuptools.extension.Extension('movienet.tools.detector.persondet.modules.core.ops.roi_align.roi_align_cuda') at 0x257c4207460>, <setuptools.extension.Extension('movienet.tools.detector.persondet.modules.core.ops.roi_pool.roi_pool_cuda') at 0x257c42070a0>, <setuptools.extension.Extension('movienet.tools.action_extractor.core.ops.nms.soft_nms_cpu') at 0x257bd34feb0>, <setuptools.extension.Extension('movienet.tools.action_extractor.core.ops.nms.nms_cpu') at 0x257c40fe6e0>, <setuptools.extension.Extension('movienet.tools.action_extractor.core.ops.nms.nms_cuda') at 0x257bd34f340>, <setuptools.extension.Extension('movienet.tools.action_extractor.core.ops.roi_align.roi_align_cuda') at 0x257bd34fc10>, <setuptools.extension.Extension('movienet.tools.action_extractor.core.ops.roi_pool.roi_pool_cuda') at 0x257bd34fb80>] WARNING: The wheel package is not available. WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))': /simple/pytest-runner/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))': /simple/pytest-runner/ WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))': /simple/pytest-runner/ WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))': /simple/pytest-runner/ WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))': /simple/pytest-runner/ ERROR: Could not find a version that satisfies the requirement pytest-runner (from versions: none) ERROR: No matching distribution found for pytest-runner Traceback (most recent call last): File "D:\python\lib\site-packages\setuptools\installer.py", line 75, in fetch_build_egg subprocess.check_call(cmd) File "D:\python\lib\subprocess.py", line 369, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['D:\python\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\Users\lyh\AppData\Local\Temp\tmp4a5b7d_1', '--quiet', 'pytest-runner']' returned non-zero exit status 1.

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

Traceback (most recent call last): File "D:\github\movienet-tools\setup.py", line 192, in setup( File "D:\python\lib\site-packages\setuptools__init__.py", line 152, in setup _install_setup_requires(attrs) File "D:\python\lib\site-packages\setuptools__init.py", line 147, in _install_setup_requires dist.fetch_build_eggs(dist.setup_requires) File "D:\python\lib\site-packages\setuptools\dist.py", line 806, in fetch_build_eggs resolved_dists = pkg_resources.working_set.resolve( File "D:\python\lib\site-packages\pkg_resources\init.py", line 766, in resolve dist = best[req.key] = env.best_match( File "D:\python\lib\site-packages\pkg_resources\init.py", line 1051, in best_match return self.obtain(req, installer) File "D:\python\lib\site-packages\pkg_resources\init__.py", line 1063, in obtain return installer(requirement) File "D:\python\lib\site-packages\setuptools\dist.py", line 877, in fetch_build_egg return fetch_build_egg(self, req) File "D:\python\lib\site-packages\setuptools\installer.py", line 77, in fetch_build_egg raise DistutilsError(str(e)) from e distutils.errors.DistutilsError: Command '['D:\python\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\Users\lyh\AppData\Local\Temp\tmp4a5b7d_1', '--quiet', 'pytest-runner']' returned non-zero exit status 1.

Using git clone https://github.com/movienet/movienet-tools.git and run python setup.py develop The problem will be solved. It seems that due to not being able to get git, it doesn't build the nms_cpu object which is a c++ file before importing it into the python file.