DavidFernandezChaves / Detectron2_ros

A ROS Node for detecting objects using Detectron2.
MIT License
51 stars 23 forks source link

Model file not found #7

Closed robotiste closed 1 month ago

robotiste commented 3 years ago

It is unable to find the "model_final_f10217.pkl" file

process[detectron2_ros-1]: started with pid [14640]
[WARN] [1632167722.433477]: Initializing
[INFO] [1632167722.442250]: [Detectron2] ~config: /home/vikas/detectron_ros/src/detectron2_ros/detectron2/configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml
[INFO] [1632167722.470800]: [Detectron2] ~detection_threshold: 0.5
[INFO] [1632167722.473040]: [Detectron2] ~model: detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl
Traceback (most recent call last):
  File "/home/vikas/detectron_ros/src/detectron2_ros/src/detectron2_ros", line 158, in <module>
    main(sys.argv)
  File "/home/vikas/detectron_ros/src/detectron2_ros/src/detectron2_ros", line 154, in main
    node = Detectron2node()
  File "/home/vikas/detectron_ros/src/detectron2_ros/src/detectron2_ros", line 34, in __init__
    self.predictor = DefaultPredictor(self.cfg)
  File "/home/vikas/.virtualenvs/detectron2_ros/lib/python3.8/site-packages/detectron2/engine/defaults.py", line 188, in __init__
    checkpointer.load(cfg.MODEL.WEIGHTS)
  File "/home/vikas/.virtualenvs/detectron2_ros/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 detectron2://COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x/137849600/model_final_f10217.pkl not found!
[detectron2_ros-1] process has died [pid 14640, exit code 1, cmd /home/vikas/detectron_ros/src/detectron2_ros/src/detectron2_ros __name:=detectron2_ros __log:=/home/vikas/.ros/log/a2aa41ea-1a4c-11ec-8c3f-2d667ddb57ab/detectron2_ros-1.log].
log file: /home/vikas/.ros/log/a2aa41ea-1a4c-11ec-8c3f-2d667ddb57ab/detectron2_ros-1*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor...
... shutting down processing monitor complete
done
DavidFernandezChaves commented 3 years ago

This is because you are not running it inside the environment properly, since it is using python 3.8. This port is intended to be used in ROS with python2. Please follow the instructions for use.

Hz19970829 commented 2 years ago

I have the same problem, do you have a solution?

Hz19970829 commented 2 years ago

Which version uses python 3.6 or 3.8? Not sure how to use python3 and python2 at the same time, can you help me? My workon environment is python 3.6, ros python 2.7

josematez commented 2 years ago

Hello, you can download the model "model_final_f10217.pkl" from here. Then, drag it into the folder where the code expects to find the model.

Hz19970829 commented 2 years ago

thanks for your answer