Thanks for your error report and we appreciate it a lot.
Checklist
I have searched related issues but cannot get the expected help.
The bug has not been fixed in the latest version.
Describe the bug
I trained MAE using mmpretrain and then loaded the weights as backbone and got an error
Reproduction
What command or script did you run?
python tools/train.py configs/mae/mae-base_upernet_8xb2-amp-160k.py
Did you make any modifications on the code or config? Did you understand what you have modified?
backbone=dict(
_delete=True,
type='mmpretrain.MAE',
arch='base',
patch_size=16,
in_chans=3,
embed_dim=768,
decoder_embed_dim=512,
decoder_depth=8,
decoder_num_heads=16,
mlp_ratio=4.,
init_values=1.0,
drop_path_rate=0.1,
out_indices=[3, 5, 7, 11], #修改 out_indices
init_cfg=dict(
type='Pretrained',
checkpoint=pretrained,
prefix='backbone.')),
What dataset did you use?
ADE20K
Environment
Please run python mmseg/utils/collect_env.py to collect necessary environment information and paste it here.
sys.platform: linux
Python: 3.8.18 (default, Sep 11 2023, 13:40:15) [GCC 11.2.0]
CUDA available: True
numpy_random_seed: 2147483648
GPU 0: NVIDIA TITAN X (Pascal)
CUDA_HOME: /usr/local/cuda-10.2
NVCC: Cuda compilation tools, release 10.2, V10.2.8
GCC: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
PyTorch: 1.12.1+cu102
PyTorch compiling details: PyTorch built with:
GCC 7.3
C++ Version: 201402
Intel(R) Math Kernel Library Version 2020.0.0 Product Build 20191122 for Intel(R) 64 architecture applications
You may add addition that may be helpful for locating the problem, such as
How you installed PyTorch [e.g., pip, conda, source]
Other environment variables that may be related (such as $PATH, $LD_LIBRARY_PATH, $PYTHONPATH, etc.)
Error traceback
If applicable, paste the error trackback here.
A placeholder for trackback.
Bug fix
If you have already identified the reason, you can provide the information here. If you are willing to create a PR to fix it, please also leave a comment here and that would be much appreciated!
Thanks for your error report and we appreciate it a lot.
Checklist
Describe the bug I trained MAE using mmpretrain and then loaded the weights as backbone and got an error![2024-05-10 13-41-25屏幕截图](https://github.com/open-mmlab/mmsegmentation/assets/86768013/17efafb4-fd2d-4856-a317-7a06d4631dde)
Reproduction
What command or script did you run? python tools/train.py configs/mae/mae-base_upernet_8xb2-amp-160k.py
Did you make any modifications on the code or config? Did you understand what you have modified? backbone=dict( _delete=True,
type='mmpretrain.MAE', arch='base',
patch_size=16, in_chans=3, embed_dim=768, decoder_embed_dim=512, decoder_depth=8, decoder_num_heads=16, mlp_ratio=4., init_values=1.0, drop_path_rate=0.1, out_indices=[3, 5, 7, 11], #修改 out_indices init_cfg=dict( type='Pretrained', checkpoint=pretrained, prefix='backbone.')),
What dataset did you use? ADE20K Environment
Please run
python mmseg/utils/collect_env.py
to collect necessary environment information and paste it here. sys.platform: linux Python: 3.8.18 (default, Sep 11 2023, 13:40:15) [GCC 11.2.0] CUDA available: True numpy_random_seed: 2147483648 GPU 0: NVIDIA TITAN X (Pascal) CUDA_HOME: /usr/local/cuda-10.2 NVCC: Cuda compilation tools, release 10.2, V10.2.8 GCC: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 PyTorch: 1.12.1+cu102 PyTorch compiling details: PyTorch built with:TorchVision: 0.13.1+cu102 OpenCV: 4.8.1 MMEngine: 0.8.4 MMSegmentation: 1.0.0+e64548f
$PATH
,$LD_LIBRARY_PATH
,$PYTHONPATH
, etc.)Error traceback
If applicable, paste the error trackback here.
Bug fix
If you have already identified the reason, you can provide the information here. If you are willing to create a PR to fix it, please also leave a comment here and that would be much appreciated!