-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrun.py
More file actions
executable file
·36 lines (33 loc) · 936 Bytes
/
run.py
File metadata and controls
executable file
·36 lines (33 loc) · 936 Bytes
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
#! /home/apd10/anaconda3/bin/python
import torch
torch.manual_seed(0)
from torch import nn
import torch.multiprocessing as mp
import torch.utils.data
from torch.autograd import Variable
import numpy as np
from os import path
import os
import pdb
import argparse
from os.path import dirname, abspath, join
import glob
cur_dir = dirname(abspath(__file__))
import yaml
from main_modules.Loop import *
from main_modules.Stats import *
parser = argparse.ArgumentParser()
parser.add_argument('--config', action="store", dest="config", type=str, default=None, required=True,
help="config to setup the training")
results = parser.parse_args()
config_file = results.config
with open(config_file, "r") as f:
config = yaml.load(f, Loader=yaml.FullLoader)
if config['module'] == "Loop":
run = Loop(config)
run.loop()
elif config["module"] == "Stats":
run = Stats(config)
run.run()
else:
raise NotImplementedError