-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
39 lines (30 loc) · 954 Bytes
/
test.py
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
import os
import torch
import torch.nn.functional as F
import torchvision
import numpy as np
import random
import time
from config import Config
from torch.nn import DataParallel
from torch.optim.lr_scheduler import StepLR
from test import *
from tqdm import tqdm
import data_loader as module_data
import loss as module_loss
import metric as module_metric
import model as module_model
import torch.nn as nn_loss
from trainer import Trainer
if __name__ == '__main__':
config = Config()
config.TEST = True
test_loader = module_data.TestDataLoader(config.TEST_LIST, config.TEST_BATCH_SIZE,opt = config)
model = getattr(module_model,config.RESUME_MODEL)(config)
trainer = Trainer(model, None,None, None, None,
opt=config,
data_loader=test_loader,
valid_data_loader=None,
lr_scheduler=None)
print('start test')
trainer.test()