Open saikrishnadas opened 4 years ago
Where did you download yolov4.weights? I have the same error with darknet yolov3.weights. The demo works fine with the weights: https://drive.google.com/open?id=1cewMfusmPjYWbrnuJRuKhPMwRe_b9PaT
@zateyev I did download it from that drive but still i get that error :(
@saikrishnadas @zateyev try changing the .names file in ./data/classes
I am getting a similar error: ValueError: cannot reshape array of size 4576092 into shape (1024,512,3,3). I have trained a custom dataset on the darknet framework and wish to migrate it to tensorflow.
@karanpatel1993 It seems you are just picking the wrong version. Try to run:
python convert_tflite.py --weights ./data/yolov4.weights --output ./data/udl_tiny1.tflite --model yolov4
To convert a model trained on a custom dataset I've changed utils.load_weights(model, FLAGS.weights)
to model.load_weights(FLAGS.weights).expect_partial()
in convert_tflite.py and run python convert_tflite.py --weights ./checkpoints/yolov4 --output ./data/yolov4.tflite --model yolov4
@zateyev For me when i run the demo script detect.py on yolov4.weight file from the repo's drive and same error when I try to convert that weight into TensorRT :(
conv_weights = conv_weights.reshape(conv_shape).transpose([2, 3, 1, 0])
ValueError: cannot reshape array of size 1665179 into shape (512,512,3,3)
@saikrishnadas @zateyev try changing the .names file in ./data/classes
I can confirm that this works. I edited the coco.names and entered my classes from classes.txt that labelimg creates. Thanks alot!
@PJaderbrink I tried converting the original yolov4.weight file that was trained on coco dataset. So I think there isn't any need for me to change the coco.names :( Is there anything I can do to make it convert the weight ?
@PJaderbrink I tried converting the original yolov4.weight file that was trained on coco dataset. So I think there isn't any need for me to change the coco.names :( Is there anything I can do to make it convert the weight ?
Oh ok, in that case I don't know. I've not tried to convert the original weights, just a custom model.
@zateyev @mathiasjose @hunglc007 any updates on the issue? "Covert the original weight to tensorrt"
@saikrishnadas @zateyev try changing the .names file in ./data/classes
I had the same problem and it worked for me, actually I changed the config file so I won`t have to change coco.names, as I say here: https://github.com/hunglc007/tensorflow-yolov4-tflite/issues/82#issuecomment-650998273
python detect.py --weights ./data/yolov4.weights --framework tf --size 608 --image ./data/kite.jpg
ERROR LOG: