hunglc007 / tensorflow-yolov4-tflite

YOLOv4, YOLOv4-tiny, YOLOv3, YOLOv3-tiny Implemented in Tensorflow 2.0, Android. Convert YOLO v4 .weights tensorflow, tensorrt and tflite
https://github.com/hunglc007/tensorflow-yolov4-tflite
MIT License
2.23k stars 1.24k forks source link

Scaled-YOLOv4 [feature request] #280

Open AlexeyAB opened 3 years ago

AlexeyAB commented 3 years ago

@hunglc007 Hi,

There are new models: https://github.com/AlexeyAB/darknet/issues/7087

scaled_yolov4_res - копия


So, if

[yolo]
new_coords=1

Then image

And activation=logistic (sigmoid) is used in [convolutional] layer before each [yolo] layer https://github.com/AlexeyAB/darknet/blob/a298f94255a20a3198d80ea512755d9e5dddbf02/cfg/yolov4x-mish.cfg#L1408-L1435

FUZhanhong commented 3 years ago

scaled-yolov4 in this tensorflow worked? can we train on darket and test in this frameworks?

hhk7734 commented 3 years ago

https://github.com/hhk7734/tensorflow-yolov4

I tested scaled-yolov4, but not yet commit. Maybe tomorrow, you can test.

AlexeyAB commented 3 years ago

@hhk7734 Hi, Did you added and tested Scaled-YOLOv4 (yolov4-csp.cfg and yolov4-p7) to https://github.com/hhk7734/tensorflow-yolov4 ?

hhk7734 commented 3 years ago

@AlexeyAB I added only yolov4-csp and yolov4x-mish.

aparico commented 3 years ago

scaled-yolov4 in this tensorflow worked? can we train on darket and test in this frameworks?

I tried it. It didn't work. I had this error:

Traceback (most recent call last):
  File "save_model.py", line 58, in <module>
    app.run(main)
  File "C:\Python37\lib\site-packages\absl\app.py", line 303, in run
    _run_main(main, args)
  File "C:\Python37\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 "D:\swap\20210319\tensorflow-yolov4-tflite\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 3791890 into shape (1024,512,3,3)
hibaalqaysi commented 3 years ago

I tried it. It didn't work. I had this error:

Traceback (most recent call last):
  File "save_model.py", line 58, in <module>
    app.run(main)
  File "C:\Python37\lib\site-packages\absl\app.py", line 303, in run
    _run_main(main, args)
  File "C:\Python37\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 "D:\swap\20210319\tensorflow-yolov4-tflite\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 3791890 into shape (1024,512,3,3)

Hi @aparico, did you fix that problem please? I'm having the same issue.

aparico commented 3 years ago

I tried it. It didn't work. I had this error:

Traceback (most recent call last):
  File "save_model.py", line 58, in <module>
    app.run(main)
  File "C:\Python37\lib\site-packages\absl\app.py", line 303, in run
    _run_main(main, args)
  File "C:\Python37\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 "D:\swap\20210319\tensorflow-yolov4-tflite\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 3791890 into shape (1024,512,3,3)

Hi @aparico, did you fix that problem please? I'm having the same issue.

@hibaalqaysi I tried doing this solution instead

akashAD98 commented 3 years ago

After converting yolo-mish.weight into .pb format its not working ?? i want to convert yolov4-csp/mish.weights into both .pb & .pth format.please have look on this features.i m really grateful to you.

akashAD98 commented 3 years ago

onxx : https://github.com/onnx/onnx/issues/3475#issuecomment-842427505