Training a Custom Object Detector with TensorFlow 2.0 Custom Object Detection API 2020

preview_player
Показать описание
0:00 Introduction
0:55 Setting up Anaconda, CUDA, and cuDNN
4:46 Installing TensorFlow
6:47 Preparing our Workspace and Virtual Environment Directory Structure
12:56 Preparing the Dataset
15:12 Generating Training Data
17:19 Configuring the Training Pipeline
22:20 Training the Model
26:23 Exporting the Inference Graph
29:01 Testing out the Model

Hi! Today we train a Custom Object Detector with the newly introduced Custom Object Detection API for TensorFlow 2.0 versions.

Please raise an issue in the Github Repository if you are having any errors. I am currently having trouble with comment visibility on YouTube.

You are welcome to contact me directly through Discord. I've seen some issues with comments not showing up, so I'll just put my Discord Username here. Feel free to send me a DM. Troy and Abed#6396

Last tested on 8/11/2020 with TensorFlow GPU 2.3.0 on Windows 10

If you find anything cool or have any issues, feel free to let me know in the comments! If you enjoyed don't forget to like and subscribe!
Рекомендации по теме
Комментарии
Автор

I was following the EdgeElectronics tutorial but encountered with so many errors so I followed your tutorial, everything worked fine. Thank you so much bro!

AbdulHaseeb-ejgk
Автор

Hi Armaan. I just tried running model_main_tf2.py on my Anaconda command prompt, after a couple of minutes it says "Windows fatal exception:Access violation". What might be the problem? Would really appreciate if you could lend me a helping hand in this. Thanks in advance

anirudhatadapatri
Автор

Hello I am trying with Raspberry 4/Raspbian but always stopped at workspace preparation (Python m pip install). Error is something like tensorflow has no attribute contrib. Any advice? Thanks

andreacecchetto
Автор

Hi Armaan. Thanks a lot for your amazing video. I was working on this for many days until I saw your video and found the solution. I was wondering how I can export the number of pixels for the box it draws on the pills for image or video? Just like the xml file we used to annotate images but for the output. Thanks again

ramanabbaspour
Автор

So what are the meanings of the two folders "test" and "train" in

Is it mean that my tensorflow learn what are the things in "train" ?
Then what about the "test" ?
Is it just for testing our script work or not ?
Or basically what I want to ask is "What things should I place in these two folders ?"
By the way ! You did a great tutorial ! Nice job!

kbh
Автор

Hello, how did you fix the error when training @ 23:40?
Errors may have originated from an input operation.
Input Source operations connected to node
fn_1 (defined at

lionking
Автор

Hi, thanks for sharing this video. I have fished training models with my own data. However, when I tried to test out the finished model, I got the following error:

Loading model...Done! Took 24.696925401687622 seconds
Running inference for Traceback (most recent call last):
File "TF-image-od.py", line 96, in <module>
image_rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
cv2.error: OpenCV(4.4.0) error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'


I've tried to install opencv-python with version 4.3.0.38 but still got this error.
Could you please help me fix it? Thanks a lot.

wgf
Автор

working now trough tutorial, i stuck a bit at git of tensorflow models, maybe it would be good to put a link to git, for us nonprogramers can be big problem why command doesn't work

majstor
Автор

Hi
I tried to train data but i have a error message like : Input of GeneratorDatasetOp::Dataset will not be optimized because the dataset does not implement the AsGraphDefInternal() method needed to apply optimizations.
What can I do?

kaanakn
Автор

Hello Armaan, Great work but please can you make a similar tutorial video but this time how to train the model on Google Colab. My pc doesn't support Nvidia graphics driver

emmanuelboafo
Автор

Hi Armaan, thanks you for this Amazing tutorial.
could you help me ?
I followed to your tutorial and everything is ok, but when I tried to convert this model into JS model with using console command from official guide
Model was converted fine (without an errors)
But when I tried to load this model into JS, I got an error like "unknown Layer"
maybe you have any advices or even tutorial how to convert and load custom model into JS ?

foxil
Автор

Hi i tried implementing the transfer learning model as shown and ran into the same error that u faced when training. Could you let me know what changes u made in order to run the program? Cheers

sathyabalamurugan
Автор

Hi Armaan, after entering the command to train the model I am getting this error:
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

How can I fix this??

siddharthbondarde
Автор

Hi, when I run the command to generate the records this error is displayed :
...
File "C:\Users\lynxd\anaconda3\envs\tfod\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 80, in _preread _check
compat.path_to_str(self.__name), 1024 * 512)
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0x92 in position 122: invalid start byte

Can you help me pls?

quentinbleneau
Автор

How to solve == AttributeError: module 'tensorflow' has no attribute 'contrib' , iam traning with google colab, tensorflow 2.3.0, the error shows when run this line of code " ! sudo python3 model_builder_tf2_test.py install ", can you help me !.

gibsonvarghese
Автор

Hi!! thank you so much for your video Armaan you help me with working with TensorFlow custom model.

NoName-xsbg
Автор

hi Armaan thank you for making this video very easy to follow! just one question, after i finished training my custom dataset to detect couple of sushi types, and try to test it with your TF-image-od.py code, somehow ive managed to produced this error :

2020-10-05 11:51:36.745875: F Attempting to fetch value instead of handling error Internal: failed to get device attribute 13 for device 0: CUDA_ERROR_UNKNOWN: unknown error

my device is as follows:
windows 10 64bit
CUDA 10.1
cudnn 7.6.5
tensorflow 2.3.0
python 3.8
nvidia gt 740m with 425.31 driver (april 2019, this is the 'latest' driver for my gpu)

someone suggest to reinstall the tensorflow but it still produce this error, and the other suggest to upgrade the latest gpu driver but in my case the latest driver is as old as april 2019, any idea to navigate this issue? thanks again

kangsalep
Автор

@31:53 in the object detector window, my output doesn't have green boxes label. Do you know what the problem is?

creeda.
Автор

Hi, i have many questions about it. I'm surprised at how accurately you describe everything. This is the clearest tutorial I've found on youtube.


First of all, I would like to congratulate everyone on the New Year and wish everyone happiness and health!

And now to the point.
I make a model Object Detection with Tensorflow and architecture SSD MobileNet V2 FPNLite 640x640 like you. I use GPU.

Questions:

1. You said have to stop training when loss between 0.15 and 0.20. But you have 100 images. I have 756 images of two objects. Is it means than my losses have to be between 0.10 and 0.05 ? If i stop model at the moment when losses are equal 0.02 it's overfitting ?

2. If numbers of images equal 756, have I to change in pipeline.config the number epochs in field num_epoch. I put 1 and 3(optimal) earlier, but I didn't see the difference and now 10. I know that the more epochs, it can recognize better, but it will be possible to overfitting if epochs are too many, so what is the optimal number of epochs to put in num_epoch for Model Net 2, it's important ?

3. I was told that overfitting is impossible if I use this method of creation model Mobile Net, that you used. It's true?

4. If it is wrong, what are conditions of overfitting and how will I notice overfitting, how to understand what it is happening, and under what characteristics of model MobileNet in pipeline.config ?

I think the answers to these questions will help me solve this problem :
- the model recognizes perfectly the objects that it should, but at the same time it recognizes arbitrary objects that are not even an object. It's just like areas. It just outlines areas that are not understandable, but somewhat similar to each other, but she should not recognize these areas. I think this is underfitting, and I want to change that by adjusting the number of eras.

I would be glad for any help.
It's vary important for me !
Thank you for the answers !

tetianaluhacheva
Автор

Hi, I have a problem: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcd in position 117: invalid continuation byte
and
TypeError: memoryview: a bytes-like object is required, not 'str'?
HELP!!!!

ЭмильДюмеев-сн