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

#970 Update YoloNASQuickstart.md

Merged
Ghost merged 1 commits into Deci-AI:master from deci-ai:bugfix/SG-000_fix_readme_yolonas_snippets
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
37
38
39
40
41
42
43
44
  1. """
  2. Evaluate a SuperGradient's recipes.
  3. Use this script if:
  4. - You want to evaluate a pretrained model from model zoo
  5. - You want to evaluate a checkpoint from one of your previous experiment, but with different validation parameters
  6. such as dataset params or metrics for instance
  7. Don't use this script if:
  8. - You want to train and evaluate a model (use examples/train_from_recipe_example)
  9. - You want to evaluate a checkpoint from one of your previous experiment, using the same parameters as used during the
  10. training of the experiment (use examples/evaluate_checkpoint_example)
  11. Note:
  12. This script does NOT run TRAINING, so make sure in the recipe that you load a PRETRAINED MODEL
  13. either from one of your checkpoint or from a pretrained model.
  14. General use: python -m super_gradients.evaluate_from_recipe --config-name="DESIRED_RECIPE".
  15. -> Evaluate the latest checkpoint according to parameters set in "DESIRED_RECIPE"
  16. You can specify which checkpoint you want to evaluate by overriding training_hyperparams.ckpt_name as in the following example:
  17. python -m super_gradients.evaluate_from_recipe --config-name="DESIRED_RECIPE" training_hyperparams.ckpt_name=average_model.pth
  18. -> Evaluate the checkpoint 'average_model.pth' according to parameters set in "DESIRED_RECIPE"
  19. For recipe's specific instructions and details refer to the recipe's configuration file in the recipes directory.
  20. """
  21. from omegaconf import DictConfig
  22. import hydra
  23. from super_gradients import Trainer, init_trainer
  24. @hydra.main(config_path="recipes", version_base="1.2")
  25. def _main(cfg: DictConfig) -> None:
  26. Trainer.evaluate_from_recipe(cfg)
  27. def main() -> None:
  28. init_trainer() # `init_trainer` needs to be called before `@hydra.main`
  29. _main()
  30. if __name__ == "__main__":
  31. main()
Discard
Tip!

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