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
45
46
47
48
  1. class DatasetValidationException(Exception):
  2. pass
  3. class ParameterMismatchException(DatasetValidationException):
  4. pass
  5. class IllegalDatasetParameterException(DatasetValidationException):
  6. """
  7. Exception raised illegal dataset param.
  8. :param desc: Explanation of the error
  9. """
  10. def __init__(self, desc: str):
  11. self.message = "Unsupported dataset parameter format: " + desc
  12. super().__init__(self.message)
  13. class EmptyDatasetException(DatasetValidationException):
  14. """
  15. Exception raised when a dataset does not have any image for a specific config
  16. :param desc: explanation of the error
  17. """
  18. def __init__(self, desc: str):
  19. self.message = "Empty Dataset: " + desc
  20. super().__init__(self.message)
  21. class UnsupportedBatchItemsFormat(ValueError):
  22. """Exception raised illegal batch items returned from data loader.
  23. :param batch_items: batch items returned from data loader
  24. """
  25. def __init__(self, batch_items: tuple):
  26. self.message = (
  27. f"The data loader is expected to return 2 to 3 items, but got {len(batch_items)} instead.\n"
  28. "Items expected:\n"
  29. " - inputs = batch_items[0] # model input - The type might depend on the model you are using.\n"
  30. " - targets = batch_items[1] # Target that will be used to compute loss/metrics - The type might depend on the function you are using.\n"
  31. " - [OPTIONAL] additional_batch_items = batch_items[2] # Dict made of any additional item that you might want to use.\n"
  32. "To fix this, please change the implementation of your dataset __getitem__ method, so that it would return the items defined above.\n"
  33. )
  34. super().__init__(self.message)
Discard
Tip!

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