你好,通过指令:python convert_tflite.py --weights ./data/yolov4.weights --output ./data/yolov4-fp16.tflite --quantize_mode float16
我想把一个在darknet框架下训练得到的.weights权重文件转为tflite文件,但是出现了如下问题:
ValueError: cannot reshape array of size 4559937 into shape (1024,512,3,3)
具体报错内容如下
Traceback (most recent call last):
File "convert_tflite.py", line 109, in <module>
app.run(main)
File "E:\anaconda\envs\python-train\lib\site-packages\absl\app.py", line 299, in run
_run_main(main, args)
File "E:\anaconda\envs\python-train\lib\site-packages\absl\app.py", line 250, in _run_main
sys.exit(main(argv))
File "convert_tflite.py", line 104, in main
save_tflite()
File "convert_tflite.py", line 59, in save_tflite
utils.load_weights(model, FLAGS.weights)
File "E:\11yolov4\tensorflow-yolov4-tflite\tensorflow-yolov4-tflite-master\core\utils.py", line 114, in load_weights
conv_weights = conv_weights.reshape(conv_shape).transpose([2, 3, 1, 0])
ValueError: cannot reshape array of size 4559937 into shape (1024,512,3,3)
你好,通过指令:
python convert_tflite.py --weights ./data/yolov4.weights --output ./data/yolov4-fp16.tflite --quantize_mode float16
我想把一个在darknet框架下训练得到的.weights权重文件转为tflite文件,但是出现了如下问题:ValueError: cannot reshape array of size 4559937 into shape (1024,512,3,3)
具体报错内容如下请问如何可以解决这个问题?