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

Problems in using pre-trained models #22

Closed
liverishabh opened this issue Jun 26, 2020 · 4 comments
Closed

Problems in using pre-trained models #22

liverishabh opened this issue Jun 26, 2020 · 4 comments

Comments

@liverishabh
Copy link

Hi @hpanwar08 ,
I was trying to use your pre-trained models for prediction by following your instructions and using the below command:

python demo/demo.py --config-file configs/DLA_mask_rcnn_X_101_32x8d_FPN_3x.yaml --input "<path to image.jpg>" --output <path to save the predicted image> --confidence-threshold 0.5 --opts MODEL.WEIGHTS <path to model_final_trimmed.pth> MODEL.DEVICE cpu

I am using Google Colab for the work and I am getting this error:

Traceback (most recent call last):
  File "demo/demo.py", line 73, in <module>
    demo = VisualizationDemo(cfg)
  File "/content/drive/My Drive/PublayNet/detectron2/demo/predictor.py", line 35, in __init__
    self.predictor = DefaultPredictor(cfg)
  File "/usr/local/lib/python3.6/dist-packages/detectron2/engine/defaults.py", line 187, in __init__
    checkpointer.load(cfg.MODEL.WEIGHTS)
  File "/usr/local/lib/python3.6/dist-packages/fvcore/common/checkpoint.py", line 117, in load
    checkpoint = self._load_file(path)
  File "/usr/local/lib/python3.6/dist-packages/detectron2/checkpoint/detection_checkpoint.py", line 42, in _load_file
    loaded = super()._load_file(filename)  # load native pth checkpoint
  File "/usr/local/lib/python3.6/dist-packages/fvcore/common/checkpoint.py", line 213, in _load_file
    return torch.load(f, map_location=torch.device("cpu"))
  File "/usr/local/lib/python3.6/dist-packages/torch/serialization.py", line 586, in load
    with _open_zipfile_reader(f) as opened_zipfile:
  File "/usr/local/lib/python3.6/dist-packages/torch/serialization.py", line 246, in __init__
    super(_open_zipfile_reader, self).__init__(torch._C.PyTorchFileReader(name_or_buffer))
RuntimeError: [enforce fail at inline_container.cc:208] . file not found: /version
@liverishabh
Copy link
Author

Found the issue.
Thanks for this great repository

@hpanwar08
Copy link
Owner

Hey, sometimes I miss the notifications. Was the problem related to wrong model file?

@liverishabh
Copy link
Author

Yeah, sort of.
I was using wget to download the models to colab and it was getting downloaded in zipped format (although the extension was still '.pth').

@andrewbird2
Copy link

got caught by this as well. thanks!

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

3 participants