yolov8_ros
yolov8_ros copied to clipboard
Encoding error by ultralytics prediction
Hi @mgonzs13,
thank you for your great work!!!
I have an error when when running the yolov8_node the self.yolo.predict cause an error (tried on 2 different cameras):
[yolov8_node-1] RuntimeError: Given groups=1, weight of size [48, 3, 3, 3], expected input[1, 4, 384, 640] to have 3 channels, but got 4 channels instead
I could fix this after i changed the desired encoding on the cv2_bridge: from:
self.cv_bridge.imgmsg_to_cv2(msg)
to
self.cv_bridge.imgmsg_to_cv2(msg, desired_encoding='bgr8')
should we maybe add this permanent or is there some reason this encoding is empty?