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

torch.hub ghostnet example is broken due to new cupy dependency #173

Open
NicolasHug opened this issue Jan 7, 2023 · 3 comments
Open

torch.hub ghostnet example is broken due to new cupy dependency #173

NicolasHug opened this issue Jan 7, 2023 · 3 comments

Comments

@NicolasHug
Copy link

Hi all,

We're the maintainers of torch.hub and it looks like executing the code in the ghostnet example fails with the following error:

E             File "python_code/pytorch_vision_ghostnet.py", line 2, in <module>
E               model = torch.hub.load('huawei-noah/ghostnet', 'ghostnet_1x', pretrained=True)
E             File "/home/circleci/miniconda3/lib/python3.8/site-packages/torch/hub.py", line 543, in load
E               model = _load_local(repo_or_dir, model, *args, **kwargs)
E             File "/home/circleci/miniconda3/lib/python3.8/site-packages/torch/hub.py", line 570, in _load_local
E               hub_module = _import_module(MODULE_HUBCONF, hubconf_path)
E             File "/home/circleci/miniconda3/lib/python3.8/site-packages/torch/hub.py", line 88, in _import_module
E               spec.loader.exec_module(module)
E             File "<frozen importlib._bootstrap_external>", line 843, in exec_module
E             File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
E             File "/home/circleci/.cache/torch/hub/huawei-noah_ghostnet_master/hubconf.py", line 6, in <module>
E               from snnmlp_pytorch.models.snn_mlp import SNNMLP
E             File "/home/circleci/.cache/torch/hub/huawei-noah_ghostnet_master/snnmlp_pytorch/models/__init__.py", line 3, in <module>
E               from .snn_mlp import SNNMLP
E             File "/home/circleci/.cache/torch/hub/huawei-noah_ghostnet_master/snnmlp_pytorch/models/snn_mlp.py", line 8, in <module>
E               from .snn_cuda import LIFSpike
E             File "/home/circleci/.cache/torch/hub/huawei-noah_ghostnet_master/snnmlp_pytorch/models/snn_cuda.py", line 10, in <module>
E               import cupy
E           ModuleNotFoundError: No module named 'cupy'

You can find more details about the execution here.

Is cupy now a required dependency to run the ghostnet model? It seems that it wasn't before. I'd just like to make sure whether it's absolutely needed or not, as otherwise we'd need to include it in our CI as well (which we'd preferably not do).

Thanks!

@iamhankai
Copy link
Member

'cupy' is a required dependency to run SNN-MLP model in huawei-noah/Efficient-AI-Backbones

@NicolasHug
Copy link
Author

Thanks for your reply @iamhankai
Could you clarify whether this cupy dependency was added only recently, or it's always been a requirement?

@iamhankai
Copy link
Member

@Gaffey

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

No branches or pull requests

2 participants