Good video but I got the following error when converting to tflite: error: loc("batch_normalization/moving_mean"): is not immutable, try removing mutable variables in your model since mutable variables are currently not supported through this converter Any advice?
@@TheCodingBug Okay thanks. I am able to convert my YOLOv4-tiny weights to tflite. However, I encountered this error when I'm trying to test my model on images and videos: cv2.error: OpenCV(4.5.2) :-1: error: (-5:Bad argument) in function 'rectangle' > Overload resolution failed: > - Can't parse 'pt1'. Sequence item with index 0 has a wrong type > - Can't parse 'pt1'. Sequence item with index 0 has a wrong type > - Can't parse 'rec'. Expected sequence length 4, got 2 > - Can't parse 'rec'. Expected sequence length 4, got 2 Any advice?
hi coding bug i have some probleem "SavedModel file does not exist at: ./checkpoints/yolov4-416\{saved_model.pbtxt|saved_model.pb}" ,do you have solution ?
hello, your tutorial is so much helpful for my final project. but i'm confused to how i produce the metrics when testing from test dataset. How can i do that, could you give me some documentation. Thanks in advance !!
Is there any chance you could demonstrate how to also convert the model to an int8 quantized one? I think it required a representative dataset to be passed as well.
Hi TheCodinBug! Thank you so much for your tutorials! I love them! Can you please tell that how can I speed up the detection process? Currently I'm getting around 1 FPS on my CPU. I tried training on only one class, i.e person to reduce the size of weights, but there isn't any significant change in FPS. Please suggest some changes that will work on my CPU. I already tried using Google Colab but want to do the detection locally. Thanks again for your awesome tutorials! I share them with my colleagues :-)
Thank you for your appreciation. It is very difficult to get a higher FPS on the CPU using YOLOv4. Maybe I can make a video on how can we get real-time object detection using some other model.
I meet the problem when I convert yolov4-tiny into tflite, is there any suggestion that I can solve it? conv_weights = conv_weights.reshape(conv_shape).transpose([2, 3, 1, 0]) ValueError: cannot reshape array of size 374698 into shape (256,256,3,3)
tensorflow.lite.python.convert.ConverterError: :0: error: loc("batch_normalization/moving_mean"): is not immutable, try removing mutable variables in your model since mutable variables are currently not supported through this converter Error
If you are talking about android app, there should be yolo tiny tflite model in it. Make sure you are in main >> assets and not in androidTest>>assets.
HI man, I really appreciate your work. I've tried it with my custom weights and classes but a problem occur while converting ".weights" in tflite in order to use it in the android application.. File "C:\Users\fstro\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\util\serialization.py", line 69, in get_json_type raise TypeError('Not JSON Serializable:', obj) TypeError: ('Not JSON Serializable:', b' \x08Softplus\x12\x08Softplus\x1a"batch_normalization/FusedBatchNorm*\x07 \x01T\x12\x020\x01') Did you have some idea on how to fix it??
File "E:\tensorflow-yolov4-tflite-master\core\utils.py", line 151, in draw_bbox f = int(out_classes[i]) TypeError: only size-1 arrays can be converted to Python scalars
Great Tutorial,Thank you very much
Thank you so much❤, can we get full version of yolov4
Good video but I got the following error when converting to tflite:
error: loc("batch_normalization/moving_mean"): is not immutable, try removing mutable variables in your model since mutable variables are currently not supported through this converter
Any advice?
Check TF version. It should be 2.3.1
@@TheCodingBug Okay thanks. I am able to convert my YOLOv4-tiny weights to tflite. However, I encountered this error when I'm trying to test my model on images and videos:
cv2.error: OpenCV(4.5.2) :-1: error: (-5:Bad argument) in function 'rectangle'
> Overload resolution failed:
> - Can't parse 'pt1'. Sequence item with index 0 has a wrong type
> - Can't parse 'pt1'. Sequence item with index 0 has a wrong type
> - Can't parse 'rec'. Expected sequence length 4, got 2
> - Can't parse 'rec'. Expected sequence length 4, got 2
Any advice?
hi coding bug i have some probleem "SavedModel file does not exist at: ./checkpoints/yolov4-416\{saved_model.pbtxt|saved_model.pb}" ,do you have solution ?
This only works for tensorflow 2.3.1
hello, your tutorial is so much helpful for my final project. but i'm confused to how i produce the metrics when testing from test dataset. How can i do that, could you give me some documentation. Thanks in advance !!
Is there any chance you could demonstrate how to also convert the model to an int8 quantized one? I think it required a representative dataset to be passed as well.
Hi TheCodinBug! Thank you so much for your tutorials! I love them! Can you please tell that how can I speed up the detection process? Currently I'm getting around 1 FPS on my CPU. I tried training on only one class, i.e person to reduce the size of weights, but there isn't any significant change in FPS. Please suggest some changes that will work on my CPU. I already tried using Google Colab but want to do the detection locally. Thanks again for your awesome tutorials! I share them with my colleagues :-)
Thank you for your appreciation. It is very difficult to get a higher FPS on the CPU using YOLOv4. Maybe I can make a video on how can we get real-time object detection using some other model.
It would be really great if you do so, many people are waiting for it xD
amazing!
An Android App would be great!
That tutorial is a work in progress. Hopefully I'll upload that next week.
@@TheCodingBug We will wait for it bro !!
I have the same problem even in the original repo. On GPU the detection is only on the first frame while CPU runs fine but extremely low fps (1 fps)..
I meet the problem when I convert yolov4-tiny into tflite, is there any suggestion that I can solve it?
conv_weights = conv_weights.reshape(conv_shape).transpose([2, 3, 1, 0])
ValueError: cannot reshape array of size 374698 into shape (256,256,3,3)
Your weight file is not correct or you're using command of yolov4 on yolov4-tiny....
tensorflow.lite.python.convert.ConverterError: :0: error: loc("batch_normalization/moving_mean"): is not immutable, try removing mutable variables in your model since mutable variables are currently not supported through this converter Error
What's inside your assets folder? Mine is empty
If you are talking about android app, there should be yolo tiny tflite model in it. Make sure you are in main >> assets and not in androidTest>>assets.
@@TheCodingBug I'm talking about the conversion, in the checkpoints folder
@@zM4l0yOh! My bad. That folder is empty. You should have on .pb file and variables folder with the data. Assets folder does not contain anything.
@@TheCodingBug Thanks!! 😉
Can this be run on raspberry pi
HI man, I really appreciate your work. I've tried it with my custom weights and classes but a problem occur while converting ".weights" in tflite in order to use it in the android application..
File "C:\Users\fstro\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\util\serialization.py", line 69, in get_json_type
raise TypeError('Not JSON Serializable:', obj)
TypeError: ('Not JSON Serializable:', b'
\x08Softplus\x12\x08Softplus\x1a"batch_normalization/FusedBatchNorm*\x07
\x01T\x12\x020\x01')
Did you have some idea on how to fix it??
File "E:\tensorflow-yolov4-tflite-master\core\utils.py", line 151, in draw_bbox
f = int(out_classes[i])
TypeError: only size-1 arrays can be converted to Python scalars
how to solve this error