test_model_zoo.py 534 Bytes
Newer Older
1
2
3
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved

facebook-github-bot's avatar
facebook-github-bot committed
4
5
import unittest

6
import torch.nn as nn
facebook-github-bot's avatar
facebook-github-bot committed
7
8
9
10
11
12
13
14
from d2go.model_zoo import model_zoo


class TestD2GoModelZoo(unittest.TestCase):
    def test_model_zoo_pretrained(self):
        configs = list(model_zoo._ModelZooUrls.CONFIG_PATH_TO_URL_SUFFIX.keys())
        for cfgfile in configs:
            model = model_zoo.get(cfgfile, trained=True)
15
            self.assertTrue(isinstance(model, nn.Module))
facebook-github-bot's avatar
facebook-github-bot committed
16

Yanghan Wang's avatar
Yanghan Wang committed
17

facebook-github-bot's avatar
facebook-github-bot committed
18
19
if __name__ == "__main__":
    unittest.main()