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

Issue about yolov4-tiny #123

Open yuenshangli opened 4 years ago

yuenshangli commented 4 years ago

Hi, this is Sunny.

First of all, I must say you have done a wonderful job ~ Really amazing of your work ~ Well done !!!

So far I have tested the yolov4 and get a good result as follows: result

Then when I use the yolov4-tiny.weight from this website (https://github.com/AlexeyAB/darknet), it showed a very different result: result-tiny

In addition, when I tried to convert this yolov4-tiny to tflite file and I get the following error:

python convert_tflite.py --weights C:/XXXXX/checkpoints/yolov4-tiny-416 --output C:/XXXX/checkpoints/yolov4-tiny-416.tflite

image

I am using anaconda 1.9.12, Python 3.7.6 and tensorflow-gpu 2.2.0

Can I know which part might get error and any possible solution for this ?

Thank you very much and wish you have a great day ~

Lynchez commented 4 years ago

Hi , when ı convert to tflite ı get this error SavedModel file does not exist at: ./checkpoints/yolov4-416/{saved_model.pbtxt|saved_model.pb} can you see your yolov4-416 file inside pbtxt and pb

yuenshangli commented 4 years ago

Hi , when ı convert to tflite ı get this error SavedModel file does not exist at: ./checkpoints/yolov4-416/{saved_model.pbtxt|saved_model.pb} can you see your yolov4-416 file inside pbtxt and pb

Hi, yes, in my checkpoint folder, I have the saved_model.pb after done the save_model.py part

image

If you are using Windows, I think you might need to put the full path for this checkpoint folder, for example, C:/tensorflow-yolov4-tflite/checkpoints/yolov4-tiny

Best regards, Sunny

Lynchez commented 4 years ago

thanks ı using ubuntu 20.04 and yolov4-416 .hdf format ı cant open it

yuenshangli commented 4 years ago

thanks ı using ubuntu 20.04 and yolov4-416 .hdf format ı cant open it

I think you can try to use the given link by hunglc007 for getting the yolov4.weights

https://drive.google.com/open?id=1cewMfusmPjYWbrnuJRuKhPMwRe_b9PaT

Best regards, Sunny

Lynchez commented 4 years ago

thanks ı using ubuntu 20.04 and yolov4-416 .hdf format ı cant open it

I think you can try to use the given link by hunglc007 for getting the yolov4.weights

https://drive.google.com/open?id=1cewMfusmPjYWbrnuJRuKhPMwRe_b9PaT

Best regards, Sunny

Thanks but ı try to convert my own trained tiny model with my 2class dataset , I think here is my problem with hdf format but ı cant open hdf :/

VtlNmnk commented 4 years ago

guys, everything is much simpler. Change the path in the core/config.py line # 14 with the names on path to your file and everything will work as it should) I have 4 names of my classes in this file, everything works. image

alphapibeta commented 4 years ago

guys, everything is much simpler. Change the path in the core/config.py line # 14 with the names on path to your file and everything will work as it should) I have 4 names of my classes in this file, everything works. image

@VtlNmnk how did you convert the darkent.weights to .tf can you please share the command?

VtlNmnk commented 4 years ago

how did you convert the darkent.weights to .tf can you please share the command?

image The README.md file is beautifully designed. Read it!

alphapibeta commented 4 years ago

@VtlNmnk Matter of fact, I did go through the README.md, but the issue that I was facing was:

OSError: Unable to create file (Unable to open file: name = 'checkpoints/yolov4-416', errno = 2, error message = 'no such file or directory', flags = 13, o_flags = 302)

The issue was resolved by installing the latest version of Tensorflow

alexrider1105 commented 4 years ago

Hi, this is Sunny.

First of all, I must say you have done a wonderful job ~ Really amazing of your work ~ Well done !!!

So far I have tested the yolov4 and get a good result as follows: result

Then when I use the yolov4-tiny.weight from this website (https://github.com/AlexeyAB/darknet), it showed a very different result: result-tiny

In addition, when I tried to convert this yolov4-tiny to tflite file and I get the following error:

python convert_tflite.py --weights C:/XXXXX/checkpoints/yolov4-tiny-416 --output C:/XXXX/checkpoints/yolov4-tiny-416.tflite

image

I am using anaconda 1.9.12, Python 3.7.6 and tensorflow-gpu 2.2.0

Can I know which part might get error and any possible solution for this ?

Thank you very much and wish you have a great day ~

Hi Sunny, did you resolve your issue when using yolov4-tiny to detect objects? I have the same issue as you.

yuenshangli commented 4 years ago

Hi, this is Sunny. First of all, I must say you have done a wonderful job ~ Really amazing of your work ~ Well done !!! So far I have tested the yolov4 and get a good result as follows: result Then when I use the yolov4-tiny.weight from this website (https://github.com/AlexeyAB/darknet), it showed a very different result: result-tiny In addition, when I tried to convert this yolov4-tiny to tflite file and I get the following error: python convert_tflite.py --weights C:/XXXXX/checkpoints/yolov4-tiny-416 --output C:/XXXX/checkpoints/yolov4-tiny-416.tflite image I am using anaconda 1.9.12, Python 3.7.6 and tensorflow-gpu 2.2.0 Can I know which part might get error and any possible solution for this ? Thank you very much and wish you have a great day ~

Hi Sunny, did you resolve your issue when using yolov4-tiny to detect objects? I have the same issue as you.

Hi, I not yet solve these .. still trying ..

Best regards, Sunny

alexrider1105 commented 4 years ago

Hi @yuenshangli I don't actually think there is an issue with tiny-yolov4. I tested it with a different image and it seems just find. The disparity in results between yolov4 and tiny-yolov4 on the kite image may simply be due to the difference in the weight file size

yuenshangli commented 4 years ago

Hi @yuenshangli I don't actually think there is an issue with tiny-yolov4. I tested it with a different image and it seems just find. The disparity in results between yolov4 and tiny-yolov4 on the kite image may simply be due to the difference in the weight file size

Hi @alexrider1105 Thank you very much for your clarification ^^ Appreciate alot ~

Best regards, Sunny

MC1016 commented 4 years ago

Hi, this is Sunny.

First of all, I must say you have done a wonderful job ~ Really amazing of your work ~ Well done !!!

So far I have tested the yolov4 and get a good result as follows: result

Then when I use the yolov4-tiny.weight from this website (https://github.com/AlexeyAB/darknet), it showed a very different result: result-tiny

In addition, when I tried to convert this yolov4-tiny to tflite file and I get the following error:

python convert_tflite.py --weights C:/XXXXX/checkpoints/yolov4-tiny-416 --output C:/XXXX/checkpoints/yolov4-tiny-416.tflite

image

I am using anaconda 1.9.12, Python 3.7.6 and tensorflow-gpu 2.2.0

Can I know which part might get error and any possible solution for this ?

Thank you very much and wish you have a great day ~

hi,Have you trained yoloV4-tiny successfully in this model? i met this problem Restoring weights from: ./data/yolov4-tiny.weights ... Traceback (most recent call last): File "train.py", line 171, in app.run(main) File "C:\Users\win10\Anaconda3\lib\site-packages\absl\app.py", line 299, in run _run_main(main, args) File "C:\Users\win10\Anaconda3\lib\site-packages\absl\app.py", line 250, in _run_main sys.exit(main(argv)) File "train.py", line 163, in main for image_data, target in trainset: File "E:\tensorflow-yolov4-tflite-master\core\dataset.py", line 122, in next self.train_output_sizes[2], IndexError: index 2 is out of bounds for axis 0 with size 2

mozeqiu commented 3 years ago

hai ,when i used yolov4-tiny ,i get this issus,can you help me?please thanks https://github.com/hunglc007/tensorflow-yolov4-tflite/issues/316