csguoh / MambaIR

[ECCV2024] An official pytorch implement of the paper "MambaIR: A simple baseline for image restoration with state-space model".
Apache License 2.0
443 stars 39 forks source link

import selective_scan_cuda ImportError #3

Closed sove45 closed 7 months ago

sove45 commented 8 months ago

excuse me,I raised the error when importing this package error lies: /home/dhw/anaconda3/bin/conda run -n zIR2 --no-capture-output python /home/dhw/zjb_workspace/IR/realDenoising/test_real_denoising_sidd.py Traceback (most recent call last): File "/home/dhw/zjb_workspace/IR/realDenoising/test_real_denoising_sidd.py", line 8, in from basicsr.models.archs.mambairunet_arch import MambaIRUNet File "/home/dhw/zjb_workspace/IR/basicsr/init.py", line 1, in from .archs import * File "/home/dhw/zjb_workspace/IR/basicsr/archs/init.py", line 16, in _arch_modules = [importlib.import_module(f'basicsr.archs.{file_name}') for file_name in arch_filenames] File "/home/dhw/zjb_workspace/IR/basicsr/archs/init.py", line 16, in _arch_modules = [importlib.import_module(f'basicsr.archs.{file_name}') for file_name in arch_filenames] File "/home/dhw/anaconda3/envs/zIR2/lib/python3.9/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "/home/dhw/zjb_workspace/IR/basicsr/archs/mambair_arch.py", line 11, in from mamba_ssm.ops.selective_scan_interface import selective_scan_fn, selective_scan_ref File "/home/dhw/anaconda3/envs/zIR2/lib/python3.9/site-packages/mamba_ssm/init.py", line 3, in from mamba_ssm.ops.selective_scan_interface import selective_scan_fn, mamba_inner_fn File "/home/dhw/anaconda3/envs/zIR2/lib/python3.9/site-packages/mamba_ssm/ops/selective_scan_interface.py", line 11, in import selective_scan_cuda ImportError: /home/dhw/anaconda3/envs/zIR2/lib/python3.9/site-packages/selective_scan_cuda.cpython-39-x86_64-linux-gnu.so: undefined symbol: _ZN3c104cuda20CUDACachingAllocator9allocatorE ERROR conda.cli.main_run:execute(124): conda run python /home/dhw/zjb_workspace/IR/realDenoising/test_real_denoising_sidd.py failed. (See above for error)

Process finished with exit code 1

csguoh commented 8 months ago

It seems the above error is caused by this python line import selective_scan_cuda. It may occur when you install incompatible pytorch, causal_conv1d, mamba_ssm versions. I would suggest checking the environment of the above python liarbry and try to install a compatible version to resolve the issue.