Not sure how to use checkpoints
mikkkeldp opened this issue · 2 comments
Hi,
I'm struggling to train the model. It gives me the following error:
Traceback (most recent call last):
File "projects/PanopticFCN/train.py", line 114, in <module>
launch(
File "/home/mikkel/Desktop/masters/detectron2/detectron2/engine/launch.py", line 82, in launch
main_func(*args)
File "projects/PanopticFCN/train.py", line 108, in main
trainer.resume_or_load(resume=False) #args.resume
File "/home/mikkel/Desktop/masters/detectron2/detectron2/engine/defaults.py", line 413, in resume_or_load
self.checkpointer.resume_or_load(self.cfg.MODEL.WEIGHTS, resume=resume)
File "/home/mikkel/.local/lib/python3.8/site-packages/fvcore/common/checkpoint.py", line 215, in resume_or_load
return self.load(path, checkpointables=[])
File "/home/mikkel/Desktop/masters/detectron2/detectron2/checkpoint/detection_checkpoint.py", line 53, in load
ret = super().load(path, *args, **kwargs)
File "/home/mikkel/.local/lib/python3.8/site-packages/fvcore/common/checkpoint.py", line 141, in load
assert os.path.isfile(path), "Checkpoint {} not found!".format(path)
AssertionError: Checkpoint /data/detectron2_modelzoo/basemodel/R-50-MSRA.pkl not found!
I see that it needs a .pkl file in the directory /data/detectron2_modelzoo/basemodel/, but there exists no directory like this and the README only gives a download link to the model weights which are of a .pth extension.
I run the model with the following command lines:
python3 projects/PanopticFCN/train.py --config-file projects/PanopticFCN/configs/PanopticFCN-R50-1x.yaml --num-gpus 1
Hi, this is the path to your pretrained imagenet model. If there is no imagenet model in your root dir, consider the default one provided by Detectron2 using the config WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
Ah! Thanks, seems to solve the problem.