title: How to save and load models of custom dataset in Detectron2?
body: <p>I have tried to save and load the model using:
  All keys are mapped but there is no prediction in  output
  #1</p>
  <pre><code>from detectron2.modeling import build_model
  model = build_model(cfg)
  torch.save(model.state_dict(), 'checkpoint.pth') 
  model.load_state_dict(torch.load(checkpoint_path,map_location='cpu'))
  </code></pre>
  <p>I also tried doing it using the official doc but can't understand the input format part</p>
  <pre><code>from detectron2.checkpoint import DetectionCheckpointer
  DetectionCheckpointer(model).load(file_path_or_url)  # load a file, usually from cfg.MODEL.WEIGHTS
  checkpointer = DetectionCheckpointer(model, save_dir=&quot;output&quot;)
  checkpointer.save(&quot;model_999&quot;)  # save to output/model_999.pth
  </code></pre>