Code Monkey home page Code Monkey logo

efficientvmamba's People

Contributors

eltociear avatar terrypei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

efficientvmamba's Issues

Failed loading checkpoint

Hi, I'm trying to use your code as a backbone and load the pre-training weights, but have found some issues.

I have not modified anything in efficientVMamba.py and the environment is configured correctly. I refer to your loading method in detection/test_ckpt.py and the code is as follows when I load it:

# image_encoder = Backbone_EfficientVSSM( pretrained='checkpoints/efficient_vmamba_tiny.ckpt' )
# image_encoder = Backbone_EfficientVSSM( pretrained='checkpoints/efficient_vmamba_small.ckpt' )
   image_encoder = Backbone_EfficientVSSM( pretrained='checkpoints/efficient_vmamba_base.ckpt' )

And to verify that it was loaded correctly, I changed just one line of code in Class Backbone_EfficientVSSM in efficientVMamba.py as follows:

# incompatibleKeys = self.load_state_dict(new_state_dict, strict=False) #your before
incompatibleKeys = self.load_state_dict(new_state_dict, strict=True) # changed by me

But I found the following error reported:

Successfully loaded checkpoint from checkpoints/efficient_vmamba_base.ckpt
Failed loading checkpoint from checkpoints/efficient_vmamba_base.ckpt: Error(s) in loading state_dict for Backbone_EfficientVSSM:
Missing key(s) in state_dict: "layers.0.blocks.0.norm2.weight", "layers.0.blocks.0.norm2.bias", "layers.0.blocks.0.mlp.fc1.weight", "layers.0.blocks.0.mlp.fc1.bias", "layers.0.blocks.0.mlp.fc2.weight", "layers.0.blocks.0.mlp.fc2.bias", "layers.0.blocks.1.norm2.weight", "layers.0.blocks.1.norm2.bias", "layers.0.blocks.1.mlp.fc1.weight", "layers.0.blocks.1.mlp.fc1.bias", "layers.0.blocks.1.mlp.fc2.weight", "layers.0.blocks.1.mlp.fc2.bias", "layers.0.downsample.1.weight", "layers.0.downsample.1.bias", "layers.0.downsample.3.weight", "layers.0.downsample.3.bias", "layers.1.blocks.0.norm2.weight", "layers.1.blocks.0.norm2.bias", "layers.1.blocks.0.mlp.fc1.weight", "layers.1.blocks.0.mlp.fc1.bias", "layers.1.blocks.0.mlp.fc2.weight", "layers.1.blocks.0.mlp.fc2.bias", "layers.1.blocks.1.norm2.weight", "layers.1.blocks.1.norm2.bias", "layers.1.blocks.1.mlp.fc1.weight", "layers.1.blocks.1.mlp.fc1.bias", "layers.1.blocks.1.mlp.fc2.weight", "layers.1.blocks.1.mlp.fc2.bias", "layers.1.downsample.1.weight", "layers.1.downsample.1.bias", "layers.1.downsample.3.weight", "layers.1.downsample.3.bias", "layers.2.11.1.weight", "layers.2.11.1.bias", "layers.2.11.3.weight", "layers.2.11.3.bias", "outnorm0.weight", "outnorm0.bias", "outnorm1.weight", "outnorm1.bias", "outnorm2.weight", "outnorm2.bias", "outnorm3.weight", "outnorm3.bias".
Unexpected key(s) in state_dict: "classifier.norm.weight", "classifier.norm.bias", "classifier.head.weight", "classifier.head.bias", "layers.0.downsample.reduction.weight", "layers.0.downsample.norm.weight", "layers.0.downsample.norm.bias", "layers.1.downsample.reduction.weight", "layers.1.downsample.norm.weight", "layers.1.downsample.norm.bias", "layers.2.11.reduction.weight", "layers.2.11.norm.weight", "layers.2.11.norm.bias".

The similar problem occurs when loading the other two weights. May I ask if there is a mismatch between the currently uploaded weights and the model code? Or am I missing something? Looking forward to your reply, thanks!

Speed comparison

Thank you for your work. What about the inference speed of EfficientVmamba?

How to calculate FLOPs

Hi,

Thank you for sharing your great work!
I would like to know how to calculate the computation of vision mamba, could you also provide the code or instructions for calculating the FLOPs in the table?

Thanks!

Tony

Question about Table 5

Thanks for your great work !!
And I wonder where this data VMamba-T 2.4(param) 0.9(gflops) 72.1(top@1) comes from?
Did you train VMamba-T on your own Dim=[48, 96, 192, 384] Stage=[2, 2, 4, 2] to get this version?

No offense, just curious :)
Maybe I missed some paragraphs that talks about this.

Hi, thank you very much for your work, but i meet a installed problem

Hello, thank you very much for your work, I am very interested in your work, but I have a problem in this step --"cd selective_scan && pip install . && pytest" , I would like to ask you how to solve it.
The following is a detailed error report.
`
Building wheel for selective-scan (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [64 lines of output]

  torch.__version__  = 2.0.1+cu118
  
  
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-cpython-310
  creating build/lib.linux-x86_64-cpython-310/selective_scan
  copying selective_scan/selective_scan_interface.py -> build/lib.linux-x86_64-cpython-310/selective_scan
  copying selective_scan/__init__.py -> build/lib.linux-x86_64-cpython-310/selective_scan
  running build_ext
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/mnt/d/AIPRO/EfficientVMamba-main/selective_scan/setup.py", line 108, in <module>
      setup(
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/setuptools/__init__.py", line 103, in setup
      return distutils.core.setup(**attrs)
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
      return run_commands(dist)
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
      dist.run_commands()
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/setuptools/dist.py", line 989, in run_command
      super().run_command(command)
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 364, in run
      self.run_command("build")
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/setuptools/dist.py", line 989, in run_command
      super().run_command(command)
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/setuptools/_distutils/command/build.py", line 131, in run
      self.run_command(cmd_name)
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/setuptools/dist.py", line 989, in run_command
      super().run_command(command)
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/setuptools/command/build_ext.py", line 88, in run
      _build_ext.run(self)
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
      self.build_extensions()
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 485, in build_extensions
      compiler_name, compiler_version = self._check_abi()
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 869, in _check_abi
      _, version = get_compiler_abi_compatibility_and_version(compiler)
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 337, in get_compiler_abi_compatibility_and_version
      if not check_compiler_ok_for_platform(compiler):
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 291, in check_compiler_ok_for_platform
      which = subprocess.check_output(['which', compiler], stderr=subprocess.STDOUT)
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/subprocess.py", line 421, in check_output
      return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/subprocess.py", line 526, in run
      raise CalledProcessError(retcode, process.args,
  subprocess.CalledProcessError: Command '['which', 'g++']' returned non-zero exit status 1.
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for selective-scan
Running setup.py clean for selective-scan
Failed to build selective-scan
ERROR: Could not build wheels for selective-scan, which is required to install pyproject.toml-based projects
`

pretrained model

Have you used the vim-b pre-trained model, and if you have used it, can it be made public, thank you!

未找到匹配的重载函数 csrc/selective_scan/selective_scan.cpp(246): error C2975: “knrows”:“selective_scan_fwd_cuda”的模板参数无效,应为编译时常量表达式 csrc/selective_scan/selective_scan.cpp(38): note: 参见“knrows”的声明 error: command 'D:\\software\\Microsoft\\Visual Studio2019Community\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2

Failed to build selective-scan
ERROR: Could not build wheels for selective-scan, which is required to install pyproject.toml-based projects

InvertedResidual

Hi! Thank you for release the code!
I found that in vmamba_efficient.py you have import ''from lib.models.operations import InvertedResidual'' but i cannot find where is the file operations place in the code. Did i miss something ?

Attention Question

Hello!

Thank you for the amazing work.

I am assuming BiAttn computes the self-attention, if so, I don't quite understand the reason for the conv_branch , why isn't attention computed just for the hidden states only x_ssm only?

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.