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
  1. """
  2. Evaluate a checkpoint resulting from an experiment that you ran previously.
  3. Use this script if:
  4. - You want to evaluate a checkpoint resulting from one of your previous experiment,
  5. using the same parameters (dataset, valid_metrics,...) as used during the training of the experiment.
  6. Don't use this script if:
  7. - You want to train and evaluate a model (use examples/train_from_recipe_example)
  8. - You want to evaluate a pretrained model from model zoo (use examples/evaluate_from_recipe_example)
  9. - You want to evaluate a checkpoint from one of your previous experiment, but with different validation parameters
  10. such as dataset params or metrics for instance (use examples/evaluate_from_recipe_example)
  11. Note:
  12. The parameters will be unchanged even if the recipe used for that experiment was changed since then.
  13. This is to ensure that validation of the experiment will remain exactly the same as during training.
  14. Example: python -m super_gradients.evaluate_checkpoint --experiment_name=my_experiment_name --ckpt_name=average_model.pth
  15. -> Evaluate the checkpoint average_model from experiment my_experiment_name.
  16. """
  17. from super_gradients import Trainer, init_trainer
  18. from super_gradients.common.environment.argparse_utils import pop_arg
  19. def main() -> None:
  20. init_trainer()
  21. experiment_name = pop_arg("experiment_name")
  22. ckpt_name = pop_arg("ckpt_name", default_value="ckpt_latest.pth")
  23. ckpt_root_dir = pop_arg("ckpt_root_dir", default_value=None)
  24. Trainer.evaluate_checkpoint(experiment_name=experiment_name, ckpt_name=ckpt_name, ckpt_root_dir=ckpt_root_dir)
  25. if __name__ == "__main__":
  26. main()
Discard
Tip!

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