torchnet / main.py
milselarch's picture
push to main
df07554
raw
history blame contribute delete
No virus
608 Bytes
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()