Open PatrikPatrik2 opened 3 years ago
is there any solution? I have similar problem.
In save_model.py, you will have to change your input_layer channel from 3 to 1. This works for me.
input_layer = tf.keras.layers.Input([FLAGS.input_size, FLAGS.input_size, 1])
I have trained a 1 channel yolo4 model and verified that it is working. However, when I run
python save_model.py --weights ./data/yolov4_1Chanell.weights --output ./checkpoints/yolov4-416 --input_size 416 --model yolov4
I get this error
File "save_model.py", line 58, in <module> app.run(main) File "C:\Users\patri\miniconda3\envs\yolov4-gpu-deepsort\lib\site-packages\absl\app.py", line 300, in run _run_main(main, args) File "C:\Users\patri\miniconda3\envs\yolov4-gpu-deepsort\lib\site-packages\absl\app.py", line 251, in _run_main sys.exit(main(argv)) File "save_model.py", line 54, in main save_tf() File "save_model.py", line 49, in save_tf utils.load_weights(model, FLAGS.weights, FLAGS.model, FLAGS.tiny) File "C:\Users\patri\yolov4-Orginal\core\utils.py", line 63, in load_weights conv_weights = conv_weights.reshape(conv_shape).transpose([2, 3, 1, 0]) ValueError: cannot reshape array of size 4591671 into shape (1024,512,3,3)
what is causing the error?