Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Extraction movienet-tools error #10

Open
kumar-devesh opened this issue Oct 31, 2023 · 7 comments
Open

Feature Extraction movienet-tools error #10

kumar-devesh opened this issue Oct 31, 2023 · 7 comments
Labels
question Further information is requested

Comments

@kumar-devesh
Copy link

Hi,
when performing inference using the face detector i get the error
ImportError: cannot import name 'nms_cpu' from partially initialized module 'utils.movienet_tools_subset.persondet_modules.core.ops.nms'

Its the same for movienet-tools repo. How do i fix this?

@dhruvhacks
Copy link
Member

Hello @kumar-devesh ,
Please share your py-environment details!
Specifically-

  1. Which python version is this?
  2. Output of (env) $ pip freeze

When you mention-

Its the same for movienet-tools repo

Do you mean the same issue arises when you try to use this movienet-tools repository?

@dhruvhacks dhruvhacks added the question Further information is requested label Nov 1, 2023
@kumar-devesh
Copy link
Author

Using a python 3.8 environment for feature extraction.

Do you mean the same issue arises when you try to use this movienet-tools repository?

yes

@kumar-devesh
Copy link
Author

error stack trace

  File "/home/devesh/EmoTx-CVPR2023/utils/movienet_tools_subset/persondetector.py", line 16, in <module>
    from utils.movienet_tools_subset.persondet_cascade_rcnn import CascadeRCNN
  File "/home/devesh/EmoTx-CVPR2023/utils/movienet_tools_subset/persondet_cascade_rcnn.py", line 6, in <module>
    from utils.movienet_tools_subset.persondet_modules.convfc_bbox_head import SharedFCBBoxHead
  File "/home/devesh/EmoTx-CVPR2023/utils/movienet_tools_subset/persondet_modules/convfc_bbox_head.py", line 3, in <module>
    from .bbox_head import BBoxHead
  File "/home/devesh/EmoTx-CVPR2023/utils/movienet_tools_subset/persondet_modules/bbox_head.py", line 6, in <module>
    from .core.bbox_nms import multiclass_nms
  File "/home/devesh/EmoTx-CVPR2023/utils/movienet_tools_subset/persondet_modules/core/bbox_nms.py", line 3, in <module>
    from .ops.nms import nms_wrapper
  File "/home/devesh/EmoTx-CVPR2023/utils/movienet_tools_subset/persondet_modules/core/ops/__init__.py", line 2, in <module>
    from .nms import nms
  File "/home/devesh/EmoTx-CVPR2023/utils/movienet_tools_subset/persondet_modules/core/ops/nms/__init__.py", line 1, in <module>
    from .nms_wrapper import nms
  File "/home/devesh/EmoTx-CVPR2023/utils/movienet_tools_subset/persondet_modules/core/ops/nms/nms_wrapper.py", line 4, in <module>
    from . import nms_cpu, nms_cuda
ImportError: cannot import name 'nms_cpu' from partially initialized module 'utils.movienet_tools_subset.persondet_modules.core.ops.nms' (most likely due to a circular import) (/home/devesh/EmoTx-CVPR2023/utils/movienet_tools_subset/persondet_modules/core/ops/nms/__init__.py)```

@dhruvhacks
Copy link
Member

Thanks for sharing.

I notice there are many shared dependencies, and I suspect the issue is due to the torch version mismatch-

torch==2.2.0.dev20231030+cu121
torchaudio==2.2.0.dev20231030+cu121

Movienet-tools requires torch==1.8.1; it was LTS back then.

I suggest you create a fresh environment as directed in feature_extractors/README.md:(L24-27), preferably with virtualenv and try again. Make sure not to inherit packages from any other environment.

Let us know if this fixes the issue.

@kumar-devesh
Copy link
Author

I get the same error. Have nms_cpu and nms_cuda in this import statement been defined?
from . import nms_cpu, nms_cuda

@dhruvhacks
Copy link
Member

These are cuda utilities, and they are already present in utils/movienet_tools_subset/persondet_modules/core/ops/nms/src

I will look into this later.

For now, I suggest you check your environment carefully since the packages in your shared environment-package-list do not match the given feature_extractors/feat_extraction_requirements_py38.txt.

@richieej
Copy link

Hi there,
Is there any updates on this? I am using the same feature_extractors/feat_extraction_requirements_py38.txt as in the github and I am getting the same error.
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants