naseemap47 / YOLO-NAS

Train and Inference your custom YOLO-NAS model by Single Command Line
Apache License 2.0
97 stars 13 forks source link

Does this train from scratch or uses pre-trained weights? #35

Closed Y-T-G closed 1 year ago

Y-T-G commented 1 year ago

I saw the weights flag in the code to specify pre-trained weights, but I don't see that argument being utilized anywhere in the training code. So is it currently training from scratch always?

naseemap47 commented 1 year ago

Hi @Y-T-G , It will NOT train from scrach. weights flag is for giving pre-trained weight. by default its coco, So it will train on coco weight checkout https://github.com/naseemap47/YOLO-NAS/blob/master/train.py#L129

I think this will help you to understand. If you have any questions, please let me know.

Y-T-G commented 1 year ago

@naseemap47 I see. What do I do if I want to train from scratch?

naseemap47 commented 1 year ago

Hi @Y-T-G , I didn't find any option for that. Checkout super-gradients repo: https://github.com/Deci-AI/super-gradients If you find any, please let me know.

Y-T-G commented 1 year ago

@naseemap47 I think for that you just don't pass an argument to the pretrained_weights as it says in the comment here .

naseemap47 commented 1 year ago

Hi @Y-T-G , Thank you for sharing. I will look into it, and I will update this ASAP. Thank you.

naseemap47 commented 1 year ago

Hi @Y-T-G , I think pretrained_weights="cityscapes" option is removed for detection. When I tried its showing unable to get cityscapes model. Did you face any issue ?

Y-T-G commented 1 year ago

@naseemap47 Not sure about that. What I meant was you can remove that argument altogether from the function call, i.e. just don't pass pretrained_weights and it should train from scratch. You can verify that from the starting mAP which will be close to 0 because it's training from scratch.

Y-T-G commented 1 year ago

https://github.com/Y-T-G/YOLO-NAS/commit/ed597f270994471fe5aec12fd5a38809d1f35e13

This should work too. To train from scratch simply use --weight="".

naseemap47 commented 1 year ago

Hi @Y-T-G , Thank you for finding this. I will let you know after checking this.