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

assert cupy is not None, 'CuPy is not installed! #8

Closed
pangyanhua opened this issue May 29, 2023 · 9 comments
Closed

assert cupy is not None, 'CuPy is not installed! #8

pangyanhua opened this issue May 29, 2023 · 9 comments

Comments

@pangyanhua
Copy link

ssh://u21b961009@10.251.171.6:23735/opt/conda/envs/py37/bin/python -u /home/u21b961009/jupyterlab/spikformer-main/imagenet/train.py
INFO:train:Training with a single process on 1 GPUs.
Training with a single process on 1 GPUs.
Traceback (most recent call last):
File "/home/u21b961009/jupyterlab/spikformer-main/imagenet/train.py", line 804, in
main()
File "/home/u21b961009/jupyterlab/spikformer-main/imagenet/train.py", line 353, in main
drop_block_rate=None,
File "/home/u21b961009/.local/lib/python3.7/site-packages/timm/models/factory.py", line 74, in create_model
model = create_fn(pretrained=pretrained, **kwargs)
File "/home/u21b961009/jupyterlab/spikformer-main/imagenet/model.py", line 254, in spikformer
**kwargs
File "/home/u21b961009/jupyterlab/spikformer-main/imagenet/model.py", line 195, in init
embed_dims=embed_dims)
File "/home/u21b961009/jupyterlab/spikformer-main/imagenet/model.py", line 125, in init
self.proj_lif = MultiStepLIFNode(tau=2.0, detach_reset=True, backend='cupy')
File "/home/u21b961009/.local/lib/python3.7/site-packages/spikingjelly/clock_driven/neuron.py", line 823, in init
check_backend(backend)
File "/home/u21b961009/.local/lib/python3.7/site-packages/spikingjelly/clock_driven/neuron.py", line 30, in check_backend
assert cupy is not None, 'CuPy is not installed! You can install it from "https://github.com/cupy/cupy".'
AssertionError: CuPy is not installed! You can install it from "https://github.com/cupy/cupy".

进程已结束,退出代码1

@pangyanhua
Copy link
Author

how can i solve it? thx!

@pangyanhua
Copy link
Author

我按照requirement安装的库,Python 3.7.16

@ZK-Zhou
Copy link
Owner

ZK-Zhou commented May 29, 2023

pip install cupy

@pangyanhua
Copy link
Author

pip install cupy==10.3.1 ,pip install cupy都是报一样的错误。

@ZK-Zhou
Copy link
Owner

ZK-Zhou commented May 30, 2023

What kind of error did you get?

@pangyanhua
Copy link
Author

ssh://u21b961009@10.251.171.6:23735/opt/conda/envs/py37/bin/python -u /home/u21b961009/jupyterlab/spikformer-main/imagenet/train.py
INFO🚋Training with a single process on 1 GPUs.
Training with a single process on 1 GPUs.
Traceback (most recent call last):
File "/home/u21b961009/jupyterlab/spikformer-main/imagenet/train.py", line 804, in
main()
File "/home/u21b961009/jupyterlab/spikformer-main/imagenet/train.py", line 353, in main
drop_block_rate=None,
File "/home/u21b961009/.local/lib/python3.7/site-packages/timm/models/factory.py", line 74, in create_model
model = create_fn(pretrained=pretrained, **kwargs)
File "/home/u21b961009/jupyterlab/spikformer-main/imagenet/model.py", line 254, in spikformer
**kwargs
File "/home/u21b961009/jupyterlab/spikformer-main/imagenet/model.py", line 195, in init
embed_dims=embed_dims)
File "/home/u21b961009/jupyterlab/spikformer-main/imagenet/model.py", line 125, in init
self.proj_lif = MultiStepLIFNode(tau=2.0, detach_reset=True, backend='cupy')
File "/home/u21b961009/.local/lib/python3.7/site-packages/spikingjelly/clock_driven/neuron.py", line 823, in init
check_backend(backend)
File "/home/u21b961009/.local/lib/python3.7/site-packages/spikingjelly/clock_driven/neuron.py", line 30, in check_backend
assert cupy is not None, 'CuPy is not installed! You can install it from "https://github.com/cupy/cupy".'
AssertionError: CuPy is not installed! You can install it from "https://github.com/cupy/cupy".
还是这个错误。但是换成torch后端就没问题了。感觉是spikingjelly中的check_backend函数的问题

@ZK-Zhou ZK-Zhou closed this as completed Jun 21, 2023
@932179209
Copy link

Same error.
Fixed it by install the proper version of cupy with the CUDA version.

@Castrol68
Copy link

您好,我也遇到了这个问题,请问您解决了么

@ClementZhu
Copy link

同样遇到这个问题,请问没有使用cupy后端的方法吗

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

5 participants