chenhang98 / BPR

code for `Look Closer to Segment Better: Boundary Patch Refinement for Instance Segmentation`
Apache License 2.0
173 stars 23 forks source link

How to get the checkpoint file?ckpts/hrnet48_256.pth is not a checkpoint file #20

Closed AGanPoi closed 2 years ago

AGanPoi commented 2 years ago

I just run the inference code “sh tools/inference.sh configs/bpr/hrnet48_256.py ckpts/hrnet48_256.pth maskrcnn_val maskrcnn_val_refined”,and successfully pass through “convert to json format” and “build patches dataset”. But when I run "inference the network" step, it throw a error "OSError: ckpts/hrnet48_256.pth is not a checkpoint file" So the next two step also throw errors like can not find refined.pkl and refined.json

More error message: 2021-09-08 09:22:50,421 - mmseg - INFO - Loaded 172518 images Traceback (most recent call last): File "./tools/test_float.py", line 148, in main() File "./tools/test_float.py", line 117, in main checkpoint = load_checkpoint(model, args.checkpoint, map_location='cpu') File "/home/nls1/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/mmcv/runner/checkpoint.py", line 247, in load_checkpoint checkpoint = _load_checkpoint(filename, map_location) File "/home/nls1/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/mmcv/runner/checkpoint.py", line 222, in _load_checkpoint raise IOError(f'{filename} is not a checkpoint file') OSError: ckpts/hrnet48_256.pth is not a checkpoint file Traceback (most recent call last): File "./tools/test_float.py", line 148, in main() File "./tools/test_float.py", line 117, in main checkpoint = load_checkpoint(model, args.checkpoint, map_location='cpu') File "/home/nls1/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/mmcv/runner/checkpoint.py", line 247, in load_checkpoint checkpoint = _load_checkpoint(filename, map_location) File "/home/nls1/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/mmcv/runner/checkpoint.py", line 222, in _load_checkpoint raise IOError(f'{filename} is not a checkpoint file') OSError: ckpts/hrnet48_256.pth is not a checkpoint file Traceback (most recent call last): File "./tools/test_float.py", line 148, in main() File "./tools/test_float.py", line 117, in main checkpoint = load_checkpoint(model, args.checkpoint, map_location='cpu') File "/home/nls1/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/mmcv/runner/checkpoint.py", line 247, in load_checkpoint checkpoint = _load_checkpoint(filename, map_location) File "/home/nls1/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/mmcv/runner/checkpoint.py", line 222, in _load_checkpoint raise IOError(f'{filename} is not a checkpoint file') OSError: ckpts/hrnet48_256.pth is not a checkpoint file Traceback (most recent call last): File "./tools/test_float.py", line 148, in main() File "./tools/test_float.py", line 117, in main checkpoint = load_checkpoint(model, args.checkpoint, map_location='cpu') File "/home/nls1/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/mmcv/runner/checkpoint.py", line 247, in load_checkpoint checkpoint = _load_checkpoint(filename, map_location) File "/home/nls1/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/mmcv/runner/checkpoint.py", line 222, in _load_checkpoint raise IOError(f'{filename} is not a checkpoint file') OSError: ckpts/hrnet48_256.pth is not a checkpoint file Traceback (most recent call last): File "/home/nls1/anaconda3/envs/open-mmlab/lib/python3.7/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/home/nls1/anaconda3/envs/open-mmlab/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/nls1/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/distributed/launch.py", line 263, in main() File "/home/nls1/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/distributed/launch.py", line 259, in main cmd=cmd) subprocess.CalledProcessError: Command '['/home/nls1/anaconda3/envs/open-mmlab/bin/python', '-u', './tools/test_float.py', '--local_rank=3', 'configs/bpr/hrnet48_256.py', 'ckpts/hrnet48_256.pth', '--launcher', 'pytorch', '--out', 'maskrcnn_val_refined/refined.pkl']' returned non-zero exit status 1.

chenhang98 commented 2 years ago

You can find our pre-trained models here.