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

shelfnet_unit_test.py 792 B

You have to be logged in to leave a comment. Sign In
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
  1. import torch
  2. import unittest
  3. from super_gradients.training.models import ShelfNet18_LW, ShelfNet34_LW
  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(num_classes=21)
  12. shelfnet34_model = ShelfNet34_LW(num_classes=21)
  13. # FIXME: FIX MODEL FORWARD TESTING FOR SHELFNET50 and 101
  14. for model in [shelfnet18_model, shelfnet34_model]:
  15. model.eval()
  16. with torch.no_grad():
  17. output = model(dummy_input)
  18. self.assertIsNotNone(output)
  19. if __name__ == "__main__":
  20. unittest.main()
Tip!

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

Comments

Loading...