Closed vihari1729 closed 4 years ago
@LeonLok yes, I changed them and then the above error is coming. Is there anything to do with custom cfg file?.
Input shape, anchors and classes are correct. when i am trying to convert yolov4.weights to keras, I am getting something like this:
Loading weights.
Weights Header: 0 2 5 [32032000]
Converting 0
Converting 1
Converting 2
Converting 3
.
.
.
and for my custom weights model, it is something like this:
Loading weights.
Weights Header: 0 2 5 [64000]
Converting 1
Converting 2
Converting 3
.
.
.
the weights (32032000 and 6400) are around too more for yolov4.weights compare to my model. Is there something to do with this or it doesn't matter?.
Should I train fully [ 2000 3 i.e. according to darknet ,we should train for 2000 len(labels) times ] for 6000 iterations and obtain weights file(yolo-obj_6000.weights), then I should convert it to keras model or I can convert yolo.weights model to keras model at any iteration?
To be honest, I don't know. I've never had that problem.
Perhaps this is your problem: https://github.com/qqwweee/keras-yolo3/issues/17#issuecomment-384987027
I did not write convert.py
. The original code is from Ma-Dan which used qqwweee's code as the frame. Please try asking there instead.
Hello, has anyone solved this problem yet?
bump?
Any Fix?
I stumbled into this issue too. The repo has repeated code for boilerplate of tensorflow2.0/deep-sort-yolov4
and tensorflow2.0/deep-sort-yolov4-low-confidence-track-filtering
. Problem is that the convert.py
in the two folders is different.
--- /deep-sort-yolov4-low-confidence-track-filtering/convert.py 2021-08-11 18:25:24.426847255 +0200
+++ /deep-sort-yolov4/convert.py 2021-08-11 17:23:33.364568240 +0200
@@ -69,9 +69,15 @@
bns_to_load = []
for i in range(len(self.yolo4_model.layers)):
layer_name = self.yolo4_model.layers[i].name
- if layer_name.startswith('conv2d_'):
+ if layer_name.startswith('conv2d'):
+ if layer_name == 'conv2d':
+ convs_to_load.append((0, i))
+ else:
convs_to_load.append((int(layer_name[7:]), i))
- if layer_name.startswith('batch_normalization_'):
+ if layer_name.startswith('batch_normalization'):
+ if layer_name == 'batch_normalization':
+ bns_to_load.append((0, i))
+ else:
bns_to_load.append((int(layer_name[20:]), i))
convs_sorted = sorted(convs_to_load, key=itemgetter(0))
You just need to copy the deep-sort-yolov4
version to the other folder and voilà, convert is now working.
Hi, I have worked on training yolo-custom.weights with my own dataset. I took the mode(yolo-obj_1000.weights) when it finished 1000 iterations and tried to convert it to yolo-obj_1000.h5. But I am getting the following error:
also while testing my custom model yolo-obj_1000.weights, I am getting good results for images and videos