-
Notifications
You must be signed in to change notification settings - Fork 3
/
train.py
34 lines (29 loc) · 841 Bytes
/
train.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
# Copyright Niantic 2019. Patent Pending. All rights reserved.
#
# This software is licensed under the terms of the Monodepth2 licence
# which allows for non-commercial use only, the full terms of which are made
# available in the LICENSE file.
from __future__ import absolute_import, division, print_function
import numpy as np
import random
from trainer import Trainer
from options import RMSFM2Options
import torch
import os
options = RMSFM2Options()
opts = options.parse()
torch.backends.cudnn.benchmark = True
def setup_seed(seed):
torch.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
np.random.seed(seed)
random.seed(seed)
torch.backends.cudnn.deterministic = True
setup_seed(1)
if __name__ == "__main__":
trainer = Trainer(opts)
trainer.train()
'''
python train.py --gc
python train.py
'''