TensorFlow-2.x-YOLOv3 icon indicating copy to clipboard operation
TensorFlow-2.x-YOLOv3 copied to clipboard

Misleading results for TRAIN_TRANSFER in config.py

Open maxtensorflow opened this issue 4 years ago • 2 comments

Hi, I have encountered a small issue with the transfer learning process while training on a custom dataset. In your tutorial for training YOLO to recognize vehicle license plates, the config file sets the TRAIN_TRANSFER variable to be true. However, as I understood by your other tutorials transfer learning uses the knowledge of a pre-trained model on a new problem to recognize more objects than those it already knows of. So, if YOLO recognizes around 80 classes, including car, truck, etc then when doing transfer learning the results should be able to detect the 80 classes + license plate = 81 classes in total. But your results are misleading as the only object detected is license plate and all the classes that YOLO originally recognizes is somehow forgotten implying that the model has been trained from scratch.

Would you happen to know how to correct this issue?

maxtensorflow avatar Jan 30 '21 20:01 maxtensorflow

Where did I say that with transfer learning you can add new objects to already learned object detection features? "transfer learning uses the knowledge of a pre-trained model" - it uses already learned features Transfer learning is a machine learning technique where a model trained on one task is re-purposed on a second related task.

Please give me a link where it writes that you can add a new class to an already learned object detection model while using transfer learning without training it on a full dataset (for example 81 classes)

pythonlessons avatar Feb 01 '21 07:02 pythonlessons

So I guess I misunderstood the meaning of transfer learning when you mention if you trained a simple classifier to predict whether an image contains a car, you could use the knowledge that the model gained during its training to recognize other objects like a truck. in https://pylessons.com/YOLOv3-TF2-custrom-train/ I thought this line suggested that the model would be able to detect both car and truck without having to train a dataset with cars all over again.

A follow up question I have is if in both scenarios of using transfer learning or not the model would still need the complete dataset of 81 classes for example then is the only benefit of doing so is less computational power and achieve better accuracies without needing a huge amount of data?

maxtensorflow avatar Feb 01 '21 16:02 maxtensorflow