Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The environment cannot suit for swin-tiny training. #29

Closed
Leeinsn opened this issue Nov 24, 2022 · 2 comments
Closed

The environment cannot suit for swin-tiny training. #29

Leeinsn opened this issue Nov 24, 2022 · 2 comments

Comments

@Leeinsn
Copy link

Leeinsn commented Nov 24, 2022

I tried to train a swin-tiny detector, but I have got errors. If it is possible, could you please provide the corresponding environment for swin-tiny training. Thanks!
2022-11-24 15:54:27,351 - mmdet - INFO - load model from: pretrained/swin_tiny_patch4_window7_224.pth Traceback (most recent call last): File "tools/train.py", line 154, in <module> main() File "tools/train.py", line 127, in main cfg.model, train_cfg=cfg.train_cfg, test_cfg=cfg.test_cfg) File "/home/zhangyt/OrientedRepPoints/mmdet/models/builder.py", line 43, in build_detector return build(cfg, DETECTORS, dict(train_cfg=train_cfg, test_cfg=test_cfg)) File "/home/zhangyt/OrientedRepPoints/mmdet/models/builder.py", line 15, in build return build_from_cfg(cfg, registry, default_args) File "/home/zhangyt/OrientedRepPoints/mmdet/utils/registry.py", line 79, in build_from_cfg return obj_cls(**args) File "/home/zhangyt/OrientedRepPoints/mmdet/models/detectors/orientedreppoints_detector.py", line 22, in __init__ pretrained) File "/home/zhangyt/OrientedRepPoints/mmdet/models/detectors/single_stage.py", line 31, in __init__ self.init_weights(pretrained=pretrained) File "/home/zhangyt/OrientedRepPoints/mmdet/models/detectors/single_stage.py", line 35, in init_weights self.backbone.init_weights(pretrained=pretrained) File "/home/zhangyt/OrientedRepPoints/mmdet/models/backbones/swin_transformer.py", line 595, in init_weights load_checkpoint(self, pretrained, strict=False, logger=logger) File "/home/zhangyt/OrientedRepPoints/mmcv_custom/checkpoint.py", line 306, in load_checkpoint checkpoint = _load_checkpoint(filename, map_location) File "/home/zhangyt/OrientedRepPoints/mmcv_custom/checkpoint.py", line 282, in _load_checkpoint checkpoint = torch.load(filename, map_location=map_location) File "/home/zhangyt/miniconda3/envs/orientedreppoints/lib/python3.7/site-packages/torch/serialization.py", line 527, in load with _open_zipfile_reader(f) as opened_zipfile: File "/home/zhangyt/miniconda3/envs/orientedreppoints/lib/python3.7/site-packages/torch/serialization.py", line 224, in __init__ super(_open_zipfile_reader, self).__init__(torch._C.PyTorchFileReader(name_or_buffer)) RuntimeError: version_ <= kMaxSupportedFileFormatVersion INTERNAL ASSERT FAILED at /opt/conda/conda-bld/pytorch_1579022060824/work/caffe2/serialize/inline_container.cc:132, please report a bug to PyTorch. A$tempted to read a PyTorch file with version 3, but the maximum supported version for reading is 2. Your PyTorch installation may be too old. (init at /opt/conda/conda-bld/pytorch_1579022060824/work/caffe2/serialize/inline_container.cc:132) frame #0: c10::Error::Error(c10::SourceLocation, std::string const&) + 0x47 (0x7efc0602d627 in /home/zhangyt/miniconda3/envs/orientedreppoints/lib/python3.7/site-packages/torch/lib/libc10.so) frame #1: caffe2::serialize::PyTorchStreamReader::init() + 0x1f5b (0x7efc0a8fe9ab in /home/zhangyt/miniconda3/envs/orientedreppoints/lib/python3.7/site-packages/torch/lib/libtorch.so) frame #2: caffe2::serialize::PyTorchStreamReader::PyTorchStreamReader(std::string const&) + 0x64 (0x7efc0a8ffbc4 in /home/zhangyt/miniconda3/envs/orientedreppoints/lib/python3.7/site-packages/torch/lib/libtorch.so) frame #3: <unknown function> + 0x6d2146 (0x7efc3855e146 in /home/zhangyt/miniconda3/envs/orientedreppoints/lib/python3.7/site-packages/torch/lib/libtorch_python.so) frame #4: <unknown function> + 0x28ba06 (0x7efc38117a06 in /home/zhangyt/miniconda3/envs/orientedreppoints/lib/python3.7/site-packages/torch/lib/libtorch_python.so) <omitting python frames> frame #6: python() [0x4d4352] frame #8: python() [0x4d0e59] frame #10: python() [0x4ba1a9] frame #14: python() [0x4d0c7e] frame #16: python() [0x4ba1a9] frame #20: python() [0x4ba06f] frame #24: python() [0x4ba06f] frame #28: python() [0x4ba06f] frame #32: python() [0x4ba06f] frame #36: python() [0x4ba06f] frame #40: python() [0x4ba06f] frame #44: python() [0x4d0c7e] frame #45: python() [0x4bbe28] frame #50: python() [0x4ba06f] frame #54: python() [0x4ba06f] frame #58: python() [0x4ba06f] frame #61: python() [0x4ba06f]

@LiWentomng
Copy link
Owner

@Leeinsn
Hello, have you resolved this problem?If your pytorch version is 1.4, you should use the pretrained model that is processed for pytorch1.4. The pretrained model--swin_tiny_patch4_window7_224 of Swin-Tiny for pytorch1.4.0 is here.

@Leeinsn
Copy link
Author

Leeinsn commented Dec 6, 2022

Thanks for your reply! I have solved the problem by using the same environment as yours.

@Leeinsn Leeinsn closed this as completed Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants