SwinTransformer / Swin-Transformer-Object-Detection

This is an official implementation for "Swin Transformer: Hierarchical Vision Transformer using Shifted Windows" on Object Detection and Instance Segmentation.
https://arxiv.org/abs/2103.14030
Apache License 2.0
1.76k stars 374 forks source link

Cannot run demo using pretrained model #177

Open GIS-PanTianLi opened 2 years ago

GIS-PanTianLi commented 2 years ago

Thanks for your error report and we appreciate it a lot.

Checklist

  1. I have searched related issues but cannot get the expected help.
  2. I have read the FAQ documentation but cannot get the expected help.
  3. The bug has not been fixed in the latest version.

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

  1. What command or script did you run?

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

  1. Did you make any modifications on the code or config? Did you understand what you have modified? No
  2. What dataset did you use? demo/demo.jpg

Environment

  1. Please run python mmdet/utils/collect_env.py to collect necessary environment information and paste it here.
  2. 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

impiga commented 2 years ago

Hi, have you downloaded "mask_rcnn_swin_tiny_patch4_window7.pth"?

woozi1122 commented 2 years ago

sry, have you solved this problem?