Hi, I already trained my own weights and changed the <arg name="weights" default="best.pt"/> in detector.launch using my own weights. but the error occur. if there anything that i need to change?
The error are as shown below
[INFO] [1672724360.280203]: start detect node [INFO] [1672724360.308326]: Launched node for object detection Load model: /home/aiman/catkin_ws_pytorch_yolov5/src/ros_pytorch_yolov5/yolov5/weights/best.pt Traceback (most recent call last): File "/home/aiman/catkin_ws_pytorch_yolov5/src/ros_pytorch_yolov5/yolov5/detect.py", line 304, in <module> dm = detectManager() File "/home/aiman/catkin_ws_pytorch_yolov5/src/ros_pytorch_yolov5/yolov5/detect.py", line 98, in __init__ self.warmup() File "/home/aiman/catkin_ws_pytorch_yolov5/src/ros_pytorch_yolov5/yolov5/detect.py", line 162, in warmup self.model = attempt_load(self.weights, map_location=self.device) # load FP32 model File "/home/aiman/catkin_ws_pytorch_yolov5/src/ros_pytorch_yolov5/yolov5/models/experimental.py", line 118, in attempt_load ckpt = torch.load(w, map_location=map_location) # load File "/home/aiman/anaconda3/lib/python3.9/site-packages/torch/serialization.py", line 592, in load return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args) File "/home/aiman/anaconda3/lib/python3.9/site-packages/torch/serialization.py", line 851, in _load result = unpickler.load() AttributeError: Can't get attribute 'MP' on <module 'models.common' from '/home/aiman/catkin_ws_pytorch_yolov5/src/ros_pytorch_yolov5/yolov5/models/common.py'> [detect_manager-1] process has died [pid 13174, exit code 1, cmd /home/aiman/catkin_ws_pytorch_yolov5/src/ros_pytorch_yolov5/yolov5/detect.py __name:=detect_manager __log:=/home/aiman/.ros/log/424d5572-8b24-11ed-84cd-b0fc36e80577/detect_manager-1.log]. log file: /home/aiman/.ros/log/424d5572-8b24-11ed-84cd-b0fc36e80577/detect_manager-1*.log [detect_manager-1] restarting process
Thank you
Hi, I already trained my own weights and changed the
<arg name="weights" default="best.pt"/>
indetector.launch
using my own weights. but the error occur. if there anything that i need to change?The error are as shown below
[INFO] [1672724360.280203]: start detect node [INFO] [1672724360.308326]: Launched node for object detection Load model: /home/aiman/catkin_ws_pytorch_yolov5/src/ros_pytorch_yolov5/yolov5/weights/best.pt Traceback (most recent call last): File "/home/aiman/catkin_ws_pytorch_yolov5/src/ros_pytorch_yolov5/yolov5/detect.py", line 304, in <module> dm = detectManager() File "/home/aiman/catkin_ws_pytorch_yolov5/src/ros_pytorch_yolov5/yolov5/detect.py", line 98, in __init__ self.warmup() File "/home/aiman/catkin_ws_pytorch_yolov5/src/ros_pytorch_yolov5/yolov5/detect.py", line 162, in warmup self.model = attempt_load(self.weights, map_location=self.device) # load FP32 model File "/home/aiman/catkin_ws_pytorch_yolov5/src/ros_pytorch_yolov5/yolov5/models/experimental.py", line 118, in attempt_load ckpt = torch.load(w, map_location=map_location) # load File "/home/aiman/anaconda3/lib/python3.9/site-packages/torch/serialization.py", line 592, in load return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args) File "/home/aiman/anaconda3/lib/python3.9/site-packages/torch/serialization.py", line 851, in _load result = unpickler.load() AttributeError: Can't get attribute 'MP' on <module 'models.common' from '/home/aiman/catkin_ws_pytorch_yolov5/src/ros_pytorch_yolov5/yolov5/models/common.py'> [detect_manager-1] process has died [pid 13174, exit code 1, cmd /home/aiman/catkin_ws_pytorch_yolov5/src/ros_pytorch_yolov5/yolov5/detect.py __name:=detect_manager __log:=/home/aiman/.ros/log/424d5572-8b24-11ed-84cd-b0fc36e80577/detect_manager-1.log]. log file: /home/aiman/.ros/log/424d5572-8b24-11ed-84cd-b0fc36e80577/detect_manager-1*.log [detect_manager-1] restarting process
Thank you