Problems in using pre-trained models
liverishabh opened this issue · comments
liverishabh commented
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 commented
Found the issue.
Thanks for this great repository
Himanshu commented
Hey, sometimes I miss the notifications. Was the problem related to wrong model file?
liverishabh commented
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').
Andrew Bird commented
got caught by this as well. thanks!