dvlab-research / PanopticFCN

Fully Convolutional Networks for Panoptic Segmentation (CVPR2021 Oral)
Apache License 2.0
393 stars 53 forks source link

Not sure how to use checkpoints #16

Closed mikkkeldp closed 3 years ago

mikkkeldp commented 3 years ago

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

yanwei-li commented 3 years ago

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"

mikkkeldp commented 3 years ago

Ah! Thanks, seems to solve the problem.