Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The pretrained weights on ImageNet #1

Closed
libzzluo opened this issue Aug 28, 2018 · 2 comments
Closed

The pretrained weights on ImageNet #1

libzzluo opened this issue Aug 28, 2018 · 2 comments

Comments

@libzzluo
Copy link

@glenn-jocher
Hi, First of all, thank you very much for your code. I have started training for 24 hours (10 epochs) on my GTX1080, but it seems that I can't load the pre-trained weights on ImageNet (the darknet53.comv). And it takes long time to train from scratch. TAT

@glenn-jocher
Copy link
Member

glenn-jocher commented Aug 29, 2018

@libzzluo yes it takes a long time to train from scratch. I've not trained ImageNet, only COCO and xView, and in general if takes about 100-200 epochs to fully train (before overtraining begins). On COCO I get about 10-15 epochs per day on a 1080 Ti, depending on the augmentation used on the input images (augmentation is generally slow, though I've sped it up as fast as I could using the latest opencv functions).

About your second question I'm not sure I understand. The only pretrained weights I've used with the model are the yolov3 weights you can download by:

wget https://pjreddie.com/media/files/yolov3.weights

These darknet weights are loaded with load_weights() in models.py. They can be converted to PyTorch weights and loaded instead with the default PyTorch methods. These two options are both available in detect.py, where the code takes the appropriate action based on the file extension (*.pt for PyTorch, *.weights for darknet):

    weights_path = 'checkpoints/yolov3.weights'
    if weights_path.endswith('.weights'):  # saved in darknet format
        load_weights(model, weights_path)
    else:  # endswith('.pt'), saved in pytorch format
        checkpoint = torch.load(weights_path, map_location='cpu')
        model.load_state_dict(checkpoint['model'])
        del checkpoint

@jaelim
Copy link

jaelim commented Sep 18, 2018

@glenn-jocher If I understand correctly, your train.py trains a model (in this case a darknet on coco) from scratch, but not with an option to start the training with loading a pre-trained weight?

glenn-jocher pushed a commit that referenced this issue Mar 25, 2019
update from original master
chrizandr pushed a commit to chrizandr/yolov3 that referenced this issue Aug 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants