TommyAnqi / YOLOv3-Pytorch

PyTorch implementation of YOLOv3, including training and inference based on darknet and mobilnetv2
MIT License
13 stars 6 forks source link

Train using mobilenet about pretrained model #2

Open Crystalxd opened 4 years ago

Crystalxd commented 4 years ago

When I train a pascal datasets model using mobilenet, I faced the problem that is "File "train.py", line 188, in _create_model model.load_state_dict(torch.load(model_path)). FileNotFoundError: [Errno 2] No such file or directory: ' /model.pth'" Does it mean need a pretrained model? I downloaded a mobilenetv2 pretrained model on Pytorch, and appointed this model to weightfile in yolo_train.yml and modified the model_path in train.py(177 line) , but I ran into another problem that is about model dict key error, it same means model is different from net structure. Could you please tell me how to train about what model? Much appreciation!

nileshpd1211 commented 4 years ago

You can train the network from scratch by commenting out the load dict code in train.py script [lines 175-188]. This way you could train the mobilenet backbone model on your dataset.