-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtrain.py
More file actions
30 lines (22 loc) · 693 Bytes
/
train.py
File metadata and controls
30 lines (22 loc) · 693 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
from __future__ import absolute_import, division, print_function
from trainer import Trainer
from options import MonodepthOptions
import os
import torch
import numpy as np
import random
#####Seed setting for reproductivility#########
random_seed = 0
torch.manual_seed(random_seed)
torch.cuda.manual_seed(random_seed)
torch.cuda.manual_seed_all(random_seed) # if use multi-GPU
torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmark = False
np.random.seed(random_seed)
random.seed(random_seed)
###############################################
options = MonodepthOptions()
opts = options.parse()
if __name__ == "__main__":
trainer = Trainer(opts)
trainer.train()