Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 39 lines (31 sloc) 1.22 KB
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# ELEKTRONN - Neural Network Toolkit
#
# Copyright (c) 2014 - now
# Max-Planck-Institute for Medical Research, Heidelberg, Germany
# Authors: Marius Killinger, Gregor Urban
"""
elektronn-train </path/to_config_file> [--gpu={auto|false|<int>}]
"""
import os
import inspect
import matplotlib
# prevent setting of mpl qt-backend
matplotlib.use('AGG')
from elektronn.training.config import Config, default_config # the global user-set config
from elektronn.training import trainutils # contains import of mpl
# commandline arguments override config_file and gpu if given as argv
config_file, gpu = trainutils.parseargs(default_config.device)
# copies config, inits gpu (theano import)
this_file = os.path.abspath(inspect.getframeinfo(inspect.currentframe()).filename)
config = Config(config_file, gpu, this_file)
from elektronn.training import trainer # contains import of theano
os.chdir(config.save_path) # The trainer works directly in the save dir
### Main Part ################################################################################################
if __name__ == "__main__":
T = trainer.Trainer(config)
T.loadData()
T.debugGetCNNBatch()
T.createNet()
T.run()