Closed VeCAD closed 3 years ago
As I understand, the load_network doesn't pull class information. It only contains the network cfg and weights.
Hmm, the examples seem to assume that it is. The yolo.c
example only calls load_network()
before accessing the number of classes on the last layer of the network. Is it possible that the network being loaded has a final layer that doesn't have any classes?
I'll leave this open for a bit, though it sounds like this might be a bug in Darknet.
Closing as upstream issue
I was trying to get this wrapper to work and was hitting "Invalid network, it expects no classes" error. https://github.com/ros2/openrobotics_darknet_ros/blob/be4fd04c0ea8fbed80b3549283701e16145422c6/src/detector_network.cpp#L86-L89
impl_->network_
is assigned to Darknet'sload_network
function. As I understand, theload_network
doesn't pull class information. It only contains the network cfg and weights. Sonum_classes_int
will be always 0, I think.const int num_classes_int = impl_->class_names_.size()
maybe? I think this also affects thedo_nms_sort function
subsequently in the same file.https://github.com/ros2/openrobotics_darknet_ros/blob/be4fd04c0ea8fbed80b3549283701e16145422c6/src/detector_network.cpp#L137
EDIT: Anyway the network cfg file does contains classes=80 line, not sure why it still returns 0.
Found a similar issue here: https://github.com/pjreddie/darknet/issues/384. I think I will just use
load_meta
to pull the class info from coco.data