vietnh1009 / Yolo-v2-pytorch

YOLO for object detection tasks
MIT License
373 stars 107 forks source link

Save Model State Dictionary #29

Open Sukanyasingh3 opened 11 months ago

Sukanyasingh3 commented 11 months ago

When saving the model state dictionary, you use both torch.save(model, ...) and torch.save(model.state_dict(), ...). It's recommended to use the latter (state_dict()) for saving only the parameters, which is more memory-efficient. If you use torch.save(model, ...), it saves the entire model, including unnecessary information.