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

#367 fix: Request correct hydra-core

Merged
Ghost merged 1 commits into Deci-AI:master from deci-ai:hotfix/ALG-000_hydra-req
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
  1. import torch
  2. import unittest
  3. from super_gradients.training.models import ShelfNet18_LW, ShelfNet34_LW, ShelfNet50, ShelfNet101
  4. class TestShelfNet(unittest.TestCase):
  5. def test_shelfnet_creation(self):
  6. """
  7. test_shelfnet_creation - Tests the creation of the model class itself
  8. :return:
  9. """
  10. dummy_input = torch.randn(1, 3, 512, 512)
  11. shelfnet18_model = ShelfNet18_LW(classes_num=21)
  12. # VALIDATES INNER CONV LIST WAS INITIALIZED CORRECTLY
  13. self.assertTrue(shelfnet18_model.conv_out_list)
  14. shelfnet34_model = ShelfNet34_LW(classes_num=21)
  15. # VALIDATES INNER CONV LIST WAS INITIALIZED CORRECTLY
  16. self.assertTrue(shelfnet34_model.conv_out_list)
  17. shelfnet50_model = ShelfNet50(classes_num=21)
  18. # VALIDATES INNER CONV LIST WAS INITIALIZED CORRECTLY
  19. self.assertTrue(shelfnet50_model.conv_out_list)
  20. shelfnet101_model = ShelfNet101(classes_num=21)
  21. # VALIDATES INNER CONV LIST WAS INITIALIZED CORRECTLY
  22. self.assertTrue(shelfnet101_model.conv_out_list)
  23. for model in [shelfnet18_model, shelfnet34_model, shelfnet50_model, shelfnet101_model]:
  24. model.eval()
  25. with torch.no_grad():
  26. output = model(dummy_input, aux=False)
  27. self.assertIsNotNone(output)
  28. if __name__ == '__main__':
  29. unittest.main()
Discard
Tip!

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