MzeroMiko / VMamba

VMamba: Visual State Space Models,code is based on mamba
MIT License
2.16k stars 134 forks source link

If use CPU inference,an error occurs :RuntimeError: Expected u.is_cuda() to be true, but got false. #107

Open Hakur0uken opened 7 months ago

Hakur0uken commented 7 months ago

I'm new to the field of deep learning. My model was trained using GPU, and I don't encounter any issues when using GPU for inference. However, when I try to deploy it on a CPU device, I encounter an error:RuntimeError: Expected u.is_cuda() to be true, but got false. (Could this error message be improved? If so, please report an enhancement request to PyTorch.) Does this mean that I can only use GPU for inference?

woshio commented 7 months ago

The situation you encountered is the same as mine, it is missing the selective_scan_cuda library. I would like to know how to install this library.

MzeroMiko commented 7 months ago

CPU is not supported by the package selective_scan_cuda_oflex or mamba_ssm, so make sure you are using GPU.

To install selective_scan_cuda_oflex, you can cd into that directory and pip install ..

To install mamba_ssm, you can refer to mamba.

You can choose to install one of mamba_ssm or selective_scan_cuda_oflex, both works fine, with only speed difference.