hustvl / Vim

[ICML 2024] Vision Mamba: Efficient Visual Representation Learning with Bidirectional State Space Model
Apache License 2.0
2.55k stars 160 forks source link

TypeError: causal_conv1d_fwd(): incompatible function arguments. #34

Open innocence0206 opened 4 months ago

innocence0206 commented 4 months ago

Hi, thanks for the great work! I encountered the following error: image I‘m wondering if conv1d_out = causal_conv1d_cuda.causal_conv1d_fwd(x, conv1d_weight, conv1d_bias,None, True) should be conv1d_out = causal_conv1d_cuda.causal_conv1d_fwd(x, conv1d_weight, conv1d_bias, True) in mamba-1p1p1/mamba_ssm/ops/selective_scan_interface.py ?

fengxiaoming520 commented 4 months ago

I think you may be right, I encountered the same problem, I found that the function causal_conv1d_fwd() used in the code only requires passing in 4 parameters. causal_conv1d_fwd(const at::Tensor &x, const at::Tensor &weight, const c10::optional<at::Tensor> &bias_, bool silu_activation).

This is different from the same function in the official repo.

anasiri commented 4 months ago

Make sure to change "causal_conv1d>=1.1.0" to "causal_conv1d==1.1.0" in mamba-1p1p1/setup.py before installation. The causal_conv1d repo is updated and the newer versions are not compatible with this repo.

Alldaychubby commented 3 months ago

Thanks for the solution! I tried to modify causal_conv1d_cuda.causal_conv1d_fwd, but encountered another problem, may I ask how causal_conv1d_cuda.causal_conv1d_bwd should be modified? image

a912289748 commented 3 months ago

Hi, thanks for the great work! I encountered the following error: image I‘m wondering if conv1d_out = causal_conv1d_cuda.causal_conv1d_fwd(x, conv1d_weight, conv1d_bias,None, True) should be conv1d_out = causal_conv1d_cuda.causal_conv1d_fwd(x, conv1d_weight, conv1d_bias, True) in mamba-1p1p1/mamba_ssm/ops/selective_scan_interface.py ?

is no no no no nonononononono image

a912289748 commented 3 months ago

Make sure to change "causal_conv1d>=1.1.0" to "causal_conv1d==1.1.0" in mamba-1p1p1/setup.py before installation. The causal_conv1d repo is updated and the newer versions are not compatible with this repo.

什么意思,看不懂 哎,不行,教教我 我v mxnet336

TZW-056 commented 3 months ago

I have sloved this question by reinstalling causal_conv1d: pip uninstall causal_conv1d and pip install causal_conv1d==1.1.0. Because the version of causal_conv1d in official repo is 1.0.0 which is incompatible for mamba_ssm==1.1.1. 😄

Alldaychubby commented 3 months ago

在mamba-1p1p1/mamba_ssm/ops/selective_scan_interface.py文件里,conv1d_out = causal_conv1d_cuda.causal_conv1d_fwd(x, conv1d_weight, conv1d_bias,None, True) 改为 conv1d_out = causal_conv1d_cuda.causal_conv1d_fwd(x, conv1d_weight, conv1d_bias, True),还有这里也修改 ``` dx, dconv1d_weight, dconv1d_bias = causal_conv1d_cuda.causal_conv1d_bwd(

x, conv1d_weight, conv1d_bias, dconv1d_out, None, dx, True

        x, conv1d_weight, conv1d_bias, dconv1d_out, dx, True
    )

我没有复现原文的指标,只是换了另一个数据集,目前训练和测试都没问题,指标也正常。你可以尝试我这样修改,希望对你有帮助
LiwenWang919 commented 3 months ago

I have sloved this question by reinstalling causal_conv1d: pip uninstall causal_conv1d and pip install causal_conv1d==1.1.0. Because the version of causal_conv1d in official repo is 1.0.0 which is incompatible for mamba_ssm==1.1.1. 😄 Thanks, i solve this problem with this method

dandeperson commented 2 months ago

在mamba-1p1p1/mamba_ssm/ops/selective_scan_interface.py文件里, 改为 ,还有这里也修改 ` dx, dconv1d_weight, dconv1d_bias = causal_conv1d_cuda.causal_conv1d_bwd( # x, conv1d_weight, conv1d_bias, dconv1d_out, None, dx, True x, conv1d_weight, conv1d_bias, dconv1d_out, dx, True`conv1d_out = causal_conv1d_cuda.causal_conv1d_fwd(x, conv1d_weight, conv1d_bias,None, True)conv1d_out = causal_conv1d_cuda.causal_conv1d_fwd(x, conv1d_weight, conv1d_bias, True)` )


我没有复现原文的指标,只是换了另一个数据集,目前训练和测试都没问题,指标也正常。你可以尝试我这样修改,希望对你有帮助
`
您好,请问可以分享一下selective_scan_interface.py文件吗?我按照您的方法修改了,但是似乎没有生效,是否还有其他地方需要修改呢?感谢!
sivircc commented 1 month ago

I con't use "pip install" or "conda install" to get the causal_conv1d==1.1.0, I used causal_conv1d==1.1.3 by .whl, now I have no idea for the version1.1.0

chengyi-chris commented 1 month ago

I con't use "pip install" or "conda install" to get the causal_conv1d==1.1.0, I used causal_conv1d==1.1.3 by .whl, now I have no idea for the version1.1.0

Please use pip install causal_conv1d==1.1.1