JCruan519 / VM-UNet

(ARXIV24) This is the official code repository for "VM-UNet: Vision Mamba UNet for Medical Image Segmentation".
Apache License 2.0
407 stars 13 forks source link

NameError: name 'selective_scan_fn' is not defined #10

Closed DuHao55 closed 1 month ago

DuHao55 commented 4 months ago

我在运行train.py时,总是报以下的错误: 图片 经检查,我已经安装了1.0.0版本的causal-conv1d与1.0.1版本的mamba-ssm, 图片 图片

同时vmamba.py报红。 图片 请问为何会报NameError: name 'selective_scan_fn' is not defined的错误呢

xiaomengxin123 commented 4 months ago

+1

JCruan519 commented 4 months ago

@xiaomengxin123 @DuHao55

Hello, please try to install following these steps:

  1. Choose a device with a Linux platform.
  2. Ensure that your CUDA version is 11.8 or above, which can be checked by entering the command nvcc -V.
  3. Download the relevant .whl installation package from the link: https://pan.baidu.com/s/1Uza8g1pkVcbXG1F-2tB0xQ?pwd=p3h9.
  4. Uninstall the already installed packages causal_conv1d and mamba_ssm.
  5. Use pip install to directly install the corresponding .whl file.
xiaomengxin123 commented 4 months ago

yes, but the version of 11.8 is not necessary, in my experiment, I use true mamba github release, for example, my torch's version is 2.1 and I use "mamba_ssm-1.0.1+cu122torch2.1cxx11abiFALSE-cp38-cp38-linux_x86_64.whl" it also works and it's not wrong!

DuHao55 commented 4 months ago

@JCruan519 Thank you so much for your prompt and detailed response.

feililucky commented 4 months ago

Hello, I would like to ask how you found this version of mamba_ssm-1.0.1+cu122torch2.1cxx11abiFALSE-cp38-cp38-linux_x86_64.whl, my cu118torch1.14, but the corresponding one cannot be found. whl, thank you very much

xiaomengxin123 commented 4 months ago

you can get it on the mamba official github realse and you will find it soon.

feililucky commented 4 months ago

Hello, I checked some official github, but I can’t seem to find the .whl corresponding to my version.

shenglunch commented 4 months ago

@JCruan519 I ensure that the cuda is 11.8, but it still can not find the selective_scan_fn. Env: torch 2.1.0, cu118. mamba: mamba_ssm-1.0.1+cu118torch2.1cxx11abiFALSE-cp38-cp38-linux_x86_64.whl causal_conv1d: causal_conv1d-1.0.0+cu118torch2.1cxx11abiFALSE-cp38-cp38-linux_x86_64.whl

How to solve it?

Thx!

7unahan commented 4 months ago

I have same issue...

JCruan519 commented 4 months ago

@csl1994 Hello, I recommend using the following versions of torch: torch==1.13.0 torchvision==0.14.0

CosmoWood commented 4 months ago

@csl1994 Hello, I recommend using the following versions of torch: torch==1.13.0 torchvision==0.14.0

Hi I think the key is make sure the whl's(casual_conv and mamba_ssm) torch version is the same as installed version of pytorch. As I think i should solve the problems.I got 12.4 cuda and 1.13 torch.I hope it helps people who is still met this problems

1774537072 commented 2 months ago

@JCruan519 你好,你提供的网盘失效了,现在我遇到了同样的问题,NameError: name 'selective_scan_fn' is not defined. Did you mean: 'selective_scan_flop_jit'?,我按照要求进行安装的但是还是报错,请问可以再提供一下链接吗