-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.py
33 lines (27 loc) · 791 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
#!/usr/bin/python3
import argparse
import itertools
import os
import torchvision.transforms as transforms
from torch.utils.data import DataLoader
from torch.autograd import Variable
from PIL import Image
import torch
import torch.nn.functional as F
import numpy as np
from trainer import P2p_Trainer_v6
import yaml
def get_config(config):
with open(config, 'r') as stream:
return yaml.load(stream)
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--config', type=str, default='./Yaml/mrgan.yaml', help='Path to the config file.')
opts = parser.parse_args()
config = get_config(opts.config)
print("======config=======")
print(config)
trainer = P2p_Trainer_v6(config)
trainer.test()
if __name__ == '__main__':
main()