1
  1. First I downloaded the output folder of the trained model and imported it in a new project on the google colab server.
  2. In a new project without training the model, I have given the path of model_final.pth of the existing output folder to cfg.MODEL.WEIGHTS =/content/output/model_final.pth. but goes in an infinite loop. 3.I change the model weights cfg.MODEL.WEIGHTS = "detectron2://COCO-Detection/faster_rcnn_R_101_FPN_3x/137851257/model_final_f6e8b1.pkl". but still it doesn't predict objects.
  3. I change the model weights path and gave the previously trained model metrics JSON file still it not working cfg.MODEL.WEIGHTS=/content/output/metrics.json 5.By using DetectionCheckpointer(model).load("/content/output/model_final.pth") DetectionCheckpointer(model).load("detectron2://COCO-Detection/faster_rcnn_R_101_FPN_3x/137851257/model_final_f6e8b1.pkl") it gives an error model is not defined. what is this model_final.pkl file? and where did we get it? what should we do to import the existing train model and predict the objects in the new project?
cfg.MODEL.WEIGHTS = os.path.join(cfg.OUTPUT_DIR, "model_final.pth")
cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = 0.5 
cfg.DATASETS.TEST = ("microcontroller_test", )
predictor = DefaultPredictor(cfg)

Above code goes in an infinite loop

DetectionCheckpointer(model).load("/content/output/model_final.pth")
DetectionCheckpointer(model).load("detectron2://COCO-Detection/faster_rcnn_R_101_FPN_3x/137851257/model_final_f6e8b1.pkl")

Error:

NameError                                 Traceback (most recent call last)
<ipython-input-12-69f2a7846756> in <module>()
----> 1 DetectionCheckpointer(model).load("/content/output/model_final.pth")
      2 
      3 DetectionCheckpointer(model).load("detectron2://COCO-Detection/faster_rcnn_R_101_FPN_3x/137851257/model_final_f6e8b1.pkl")

NameError: name 'model' is not defined
Martin Brisiak
  • 3,872
  • 12
  • 37
  • 51

0 Answers0