File size: 608 Bytes
df07554 |
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 |
import os
import resource
from helpers import *
from Trainer import Trainer
rlimit = resource.getrlimit(resource.RLIMIT_NOFILE)
resource.setrlimit(
resource.RLIMIT_NOFILE, (65536, rlimit[1])
)
if __name__ == '__main__':
opt = __import__('options')
os.environ['CUDA_VISIBLE_DEVICES'] = opt.gpu
else:
import options as opt
if __name__ == '__main__':
print("Loading options...")
trainer = Trainer()
if hasattr(opt, 'weights'):
trainer.load_weights(opt.weights)
torch.manual_seed(opt.random_seed)
torch.cuda.manual_seed_all(opt.random_seed)
trainer.train()
|