tyshiwo1 / DiM-DiffusionMamba

The official implementation of DiM: Diffusion Mamba for Efficient High-Resolution Image Synthesis
115 stars 6 forks source link

No module named 'mamba_attn_diff.models.s6m_module' #2

Open moeinheidari7829 opened 1 month ago

moeinheidari7829 commented 1 month ago

Dear authors, thank you for the good work and open-sourcing the code, can you please provide the S6MModule in the code, once running the training script, I am facing an error as follows:

/home/moein/Desktop/Diffusion-mamba/DiM-DiffusionMamba/mamba_attn_diff/models/adapter_attn4mamba │ │ .py:14 in │ │ │ │ 11 from einops import rearrange, repeat │ │ 12 │ │ 13 from diffusers.models.embeddings import SinusoidalPositionalEmbedding, get_2d_sincos_pos │ │ ❱ 14 from .s6m_module import S6MModule │ │ 15 │ │ 16 try: │ │ 17 │ from causal_conv1d import causal_conv1d_fn, causal_conv1d_update │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ModuleNotFoundError: No module named 'mamba_attn_diff.models.s6m_module'

tyshiwo1 commented 1 month ago

Oops! It is a deprecated class. We now delete it.

moeinheidari7829 commented 1 month ago

Thank you for the prompt response; that error disappeared. However, another module is missing as follows, could you please upload the last error-free code you ran without the deprecated modules?

28 │ │ 29 from copy import deepcopy │ │ 30 │ │ ❱ 31 from mamba_ssm import Mamba │ │ 32 from mamba_attn_diff.models.adapter_attn4mamba import token_dropout │ │ 33 │ │ 34 from .normalization import * │ │ │ │ init.py:3 in │ │ │ │ 1 version = "1.2.0.post1" │ │ 2 │ │ ❱ 3 from mamba_ssm.ops.selective_scan_interface import selective_scan_fn, ma │ │ 4 from mamba_ssm.modules.mamba_simple import Mamba │ │ 5 from mamba_ssm.models.mixer_seq_simple import MambaLMHeadModel │ │ 6 │ │ │ │ ops/selective_scan_interface.py:16 in │ │ │ │ 13 │ causal_conv1d_fn = None │ │ 14 │ causal_conv1d_cuda = None │ │ 15 │ │ ❱ 16 import selective_scan_cuda │ │ 17 │ │ 18 │ │ 19 class SelectiveScanFn(torch.autograd.Function): │ ╰──────────────────────────────────────────────────────────────────────────────╯ ModuleNotFoundError: No module named 'selective_scan_cuda'

tyshiwo1 commented 1 month ago

To solve this issue, You need to successfully install and compile Mamba:

pip install causal-conv1d==1.2.0.post2 # The version maybe different depending on your cuda version
CAUSAL_CONV1D_FORCE_BUILD=TRUE pip install --user -e .

In our README, we have updated our Installation section and we also prepared a subsection named Frequently Asked Questions. You can also refer to that new Installation section for answers.

Note: Please download the new README file into your project directory for correct compilation.

We have tested our released code on our server from scratch today, and it works well for now. If you still encounter issues, feel free to ask us 😊.