yolov8_ros icon indicating copy to clipboard operation
yolov8_ros copied to clipboard

Encoding error by ultralytics prediction

Open SamuelHafner opened this issue 2 months ago • 5 comments

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?

SamuelHafner avatar May 13 '24 12:05 SamuelHafner