nobodyplayer1 / VM-UNetV2

Apache License 2.0
82 stars 11 forks source link

NameError: name 'selective_scan_fn' is not defined #2

Open OrangeCat12352 opened 7 months ago

OrangeCat12352 commented 7 months ago

我在安装代码环境的时候遇到这个问题。请问有人遇到过相同的问题吗? self.selective_scan = selective_scan_fn NameError: name 'selective_scan_fn' is not defined

我已经导入了这个包, try: from mamba_ssm.ops.selective_scan_interface import selective_scan_fn as selective_scan_fn except: pass

以及,我通过ctrl+左键点进去查看,mamba_ssm中的确存在这个函数 def selective_scan_fn(u, delta, A, B, C, D=None, z=None, delta_bias=None, delta_softplus=False, return_last_state=False): """if return_last_state is True, returns (out, last_state) last_state has shape (batch, dim, dstate). Note that the gradient of the last state is not considered in the backward pass. """ return SelectiveScanFn.apply(u, delta, A, B, C, D, z, delta_bias, delta_softplus, return_last_state)

simzhangbest commented 7 months ago

直接使用 pip 安装 selective_scan 就行了,不需要按照 visino mamba 的教程 一步步来,vmunet 那个库也提供了,离线版本的

CosmoWood commented 7 months ago

看下vmunet的issue

cunFeng233333 commented 6 months ago

hello, I have problem in install the mamba_ssm and selective_scan library. The error message is as following:

Looking in indexes: https://mirrors.aliyun.com/pypi/simple/ Collecting mamba_ssm==1.0.1 Downloading https://mirrors.aliyun.com/pypi/packages/c5/05/61d5d28786f41c7d3cc671a232b9f73e24c82fd23e8317da2b2ed36a5c73/mamba_ssm-1.0.1.tar.gz (28 kB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [11 lines of output] Traceback (most recent call last): File "", line 36, in File "", line 34, in File "/tmp/pip-install-ulqs93q8/mamba-ssm_06e7369a1d7946418d613f523b32af4c/setup.py", line 103, in f"{PACKAGE_NAME} is only supported on CUDA 11.6 and above. " RuntimeError: mamba_ssm is only supported on CUDA 11.6 and above. Note: make sure nvcc has a supported version by running nvcc -V.

  torch.__version__  = 1.13.1

  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed

× Encountered error while generating package metadata. ╰─> See above for output.

I just want to konw how to deal with the problem. Thank you for your time and help.

LYC-1021 commented 4 months ago

我在安装代码环境的时候遇到这个问题。请问有人遇到过相同的问题吗? self.selective_scan = selective_scan_fn NameError: name 'selective_scan_fn' is not defined

我已经导入了这个包, try: from mamba_ssm.ops.selective_scan_interface import selective_scan_fn as selective_scan_fn except: pass

以及,我通过ctrl+左键点进去查看,mamba_ssm中的确存在这个函数 def selective_scan_fn(u, delta, A, B, C, D=None, z=None, delta_bias=None, delta_softplus=False, return_last_state=False): """if return_last_state is True, returns (out, last_state) last_state has shape (batch, dim, dstate). Note that the gradient of the last state is not considered in the backward pass. """ return SelectiveScanFn.apply(u, delta, A, B, C, D, z, delta_bias, delta_softplus, return_last_state)

想问下您解决了这个问题吗,如果解决了可以分享是如何解决的吗