Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

efficientnet_example.py 1.2 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  1. """EfficientNet-b0 training on Imagenet
  2. TODO: This example code is the STARTING POINT for training EfficientNet - IT DIDN'T ACHIEVE THE PAPER'S ACCURACY!!!
  3. Training params are set according to https://github.com/rwightman/pytorch-image-models/issues/11
  4. Training on 4 GPUs with initial LR = 0.0032 achieves ~74.7%, (Paper=77.1% Timm=77.69%)
  5. The Tensorboards of the previous attempts: 's3/deci-model-repository-research/enet_reproduce_attempts'
  6. """
  7. import super_gradients
  8. from omegaconf import DictConfig
  9. import hydra
  10. import pkg_resources
  11. @hydra.main(config_path=pkg_resources.resource_filename("conf", ""), config_name="imagenet_efficientnet_conf")
  12. def train(cfg: DictConfig) -> None:
  13. # INSTANTIATE ALL OBJECTS IN CFG
  14. cfg = hydra.utils.instantiate(cfg)
  15. # CONNECT THE DATASET INTERFACE WITH DECI MODEL
  16. cfg.sg_model.connect_dataset_interface(cfg.dataset_interface, data_loader_num_workers=cfg.data_loader_num_workers)
  17. # BUILD NETWORK
  18. cfg.sg_model.build_model(cfg.architecture, load_checkpoint=cfg.load_checkpoint)
  19. # TRAIN
  20. cfg.sg_model.train(training_params=cfg.training_params)
  21. if __name__ == "__main__":
  22. super_gradients.init_trainer()
  23. train()
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...