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

#284 Fix training prints

Merged
oferbaratz merged 1 commits into Deci-AI:master from deci-ai:hotfix/SG-000-fix_training_prints
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
32
33
34
35
36
  1. from omegaconf import DictConfig
  2. import hydra
  3. from super_gradients.training.sg_model import MultiGPUMode
  4. from super_gradients.common.abstractions.abstract_logger import get_logger
  5. import torch
  6. class Trainer:
  7. """
  8. Class for running SuperGradient's recipes.
  9. See train_from_recipe example in the examples directory to demonstrate it's usage.
  10. """
  11. @classmethod
  12. def train(cls, cfg: DictConfig) -> None:
  13. """
  14. Trains according to cfg recipe configuration.
  15. @param cfg: The parsed DictConfig from yaml recipe files
  16. @return: output of sg_model.train(...) (i.e results tuple)
  17. """
  18. # INSTANTIATE ALL OBJECTS IN CFG
  19. cfg = hydra.utils.instantiate(cfg)
  20. # CONNECT THE DATASET INTERFACE WITH DECI MODEL
  21. cfg.sg_model.connect_dataset_interface(cfg.dataset_interface, data_loader_num_workers=cfg.data_loader_num_workers)
  22. # BUILD NETWORK
  23. cls.build_model(cfg)
  24. # TRAIN
  25. cfg.sg_model.train(training_params=cfg.training_hyperparams)
  26. @classmethod
  27. def build_model(cls, cfg):
  28. cfg.sg_model.build_model(cfg.architecture, arch_params=cfg.arch_params, checkpoint_params=cfg.checkpoint_params)
Discard
Tip!

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