- First I downloaded the output folder of the trained model and imported it in a new project on the google colab server.
- In a new project without training the model, I have given the path of
model_final.pth
of the existing output folder tocfg.MODEL.WEIGHTS
=/content/output/model_final.pth. but goes in an infinite loop. 3.I change the model weightscfg.MODEL.WEIGHTS = "detectron2://COCO-Detection/faster_rcnn_R_101_FPN_3x/137851257/model_final_f6e8b1.pkl"
. but still it doesn't predict objects. - I change the model weights path and gave the previously trained model metrics
JSON
file still it not workingcfg.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 thismodel_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