This is an official implementation for "Swin Transformer: Hierarchical Vision Transformer using Shifted Windows" on Object Detection and Instance Segmentation.
Describe the bug
I tried to run the demo with pretrained model, but it keeps showing OSError:mask_rcnn_swin_tiny_patch4_window7.pth is not a checkpoint file
Did you make any modifications on the code or config? Did you understand what you have modified? No
What dataset did you use? demo/demo.jpg
Environment
Please run python mmdet/utils/collect_env.py to collect necessary environment information and paste it here.
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
Traceback (most recent call last):
File "/root/landslide/Swin-Transformer-Object-Detection-master/demo/image_demo.py", line 26, in
main()
File "/root/landslide/Swin-Transformer-Object-Detection-master/demo/image_demo.py", line 18, in main
model = init_detector(args.config, args.checkpoint, device=args.device)
File "/root/landslide/Swin-Transformer-Object-Detection-master/mmdet/apis/inference.py", line 42, in init_detector
checkpoint = load_checkpoint(model, checkpoint, map_location=map_loc)
File "/root/miniconda3/envs/landslide/lib/python3.7/site-packages/mmcv/runner/checkpoint.py", line 531, in load_checkpoint
checkpoint = _load_checkpoint(filename, map_location, logger)
File "/root/miniconda3/envs/landslide/lib/python3.7/site-packages/mmcv/runner/checkpoint.py", line 470, in _load_checkpoint
return CheckpointLoader.load_checkpoint(filename, map_location, logger)
File "/root/miniconda3/envs/landslide/lib/python3.7/site-packages/mmcv/runner/checkpoint.py", line 249, in load_checkpoint
return checkpoint_loader(filename, map_location)
File "/root/miniconda3/envs/landslide/lib/python3.7/site-packages/mmcv/runner/checkpoint.py", line 265, in load_from_local
raise IOError(f'{filename} is not a checkpoint file')
OSError: ~/landslide/Swin-Transformer-Object-Detection-master/mask_rcnn_swin_tiny_patch4_window7.pth is not a checkpoint file
Thanks for your error report and we appreciate it a lot.
Checklist
Describe the bug I tried to run the demo with pretrained model, but it keeps showing OSError:mask_rcnn_swin_tiny_patch4_window7.pth is not a checkpoint file
Reproduction
python demo/image_demo.py demo/demo.jpg configs/swin/mask_rcnn_swin_tiny_patch4_window7_mstrain_480-800_adamw_3x_coco.py mask_rcnn_swin_tiny_patch4_window7.pth
python demo/image_demo.py demo/demo.jpg configs/swin/mask_rcnn_swin_tiny_patch4_window7_mstrain_480-800_adamw_3x_coco.py moby_mask_rcnn_swin_tiny_patch4_window7_3x.pth
Environment
python mmdet/utils/collect_env.py
to collect necessary environment information and paste it here.$PATH
,$LD_LIBRARY_PATH
,$PYTHONPATH
, etc.)Error traceback Traceback (most recent call last): File "/root/landslide/Swin-Transformer-Object-Detection-master/demo/image_demo.py", line 26, in
main()
File "/root/landslide/Swin-Transformer-Object-Detection-master/demo/image_demo.py", line 18, in main
model = init_detector(args.config, args.checkpoint, device=args.device)
File "/root/landslide/Swin-Transformer-Object-Detection-master/mmdet/apis/inference.py", line 42, in init_detector
checkpoint = load_checkpoint(model, checkpoint, map_location=map_loc)
File "/root/miniconda3/envs/landslide/lib/python3.7/site-packages/mmcv/runner/checkpoint.py", line 531, in load_checkpoint
checkpoint = _load_checkpoint(filename, map_location, logger)
File "/root/miniconda3/envs/landslide/lib/python3.7/site-packages/mmcv/runner/checkpoint.py", line 470, in _load_checkpoint
return CheckpointLoader.load_checkpoint(filename, map_location, logger)
File "/root/miniconda3/envs/landslide/lib/python3.7/site-packages/mmcv/runner/checkpoint.py", line 249, in load_checkpoint
return checkpoint_loader(filename, map_location)
File "/root/miniconda3/envs/landslide/lib/python3.7/site-packages/mmcv/runner/checkpoint.py", line 265, in load_from_local
raise IOError(f'{filename} is not a checkpoint file')
OSError: ~/landslide/Swin-Transformer-Object-Detection-master/mask_rcnn_swin_tiny_patch4_window7.pth is not a checkpoint file