Reputation: 55
I have done a custom detection in YOLOv3 over 3 classes, but the detections were not accurate so I want to retrain my custom YOLO weights with more images, but when I run it with new images it immediately finished, what is it that I have done wrong?
Here how I train it
!./darknet detector train data/obj.data cfg/yolov3_custom.cfg yolov3_custom_last.weights
The content of obj.data:
classes = 3
train = data/train.txt
valid = data/test.txt
names = data/obj.names
backup = /mydrive/yolov3/backup/
The content of yolov3_custom.cfg:
# Training
batch=64
subdivisions=16
width=416
height=416
channels=3
momentum=0.9
decay=0.0005
angle=0
saturation = 1.5
exposure = 1.5
hue=.1
learning_rate=0.001
burn_in=1000
max_batches = 6000
policy=steps
steps=4800,5400
scales=.1,.1
Upvotes: 4
Views: 4664
Reputation: 2025
Simply change the path to the weights file in the command for training the model and run it again. There is no need to update the max_batches
parameter or change the configuration file in any way. The framework is aware of how many iterations that a given set of weights has been trained for when retraining a model. For instance, if you are to stop after 2000 iterations in the initial training process, when retraining using the set of weights that was created as a result, it will begin at the 2001th iteration.
Upvotes: 3
Reputation: 11
@Hamid Shatu. You are correct. You Need to update your max_batches= and also check your Weight file Name.
Upvotes: 1