Example #1
0
File: rnn.py Project: orech/returnn
def init(configFilename=None,
         commandLineOptions=(),
         config_updates=None,
         extra_greeting=None):
    """
  :param str|None configFilename:
  :param tuple[str]|list[str]|None commandLineOptions: e.g. sys.argv[1:]
  :param dict[str]|None config_updates: see :func:`initConfig`
  :param str|None extra_greeting:
  """
    initBetterExchook()
    initThreadJoinHack()
    initConfig(configFilename=configFilename,
               commandLineOptions=commandLineOptions,
               extra_updates=config_updates)
    if config.bool("patch_atfork", False):
        from Util import maybe_restart_returnn_with_atfork_patch
        maybe_restart_returnn_with_atfork_patch()
    initLog()
    if extra_greeting:
        print(extra_greeting, file=log.v1)
    returnnGreeting(configFilename=configFilename,
                    commandLineOptions=commandLineOptions)
    initFaulthandler()
    initBackendEngine()
    if BackendEngine.is_theano_selected():
        if config.value('task', 'train') == "theano_graph":
            config.set("multiprocessing", False)
        if config.bool('multiprocessing', True):
            initCudaNotInMainProcCheck()
    if config.bool('ipython', False):
        initIPythonKernel()
    initConfigJsonNetwork()
    devices = initTheanoDevices()
    if needData():
        initData()
    printTaskProperties(devices)
    if config.value('task', 'train') == 'server':
        import Server
        global server
        server = Server.Server(config)
    else:
        initEngine(devices)
Example #2
0
def init(configFilename, commandLineOptions):
  initBetterExchook()
  initThreadJoinHack()
  initConfig(configFilename, commandLineOptions)
  initLog()
  print >> log.v3, "CRNN starting up, version %s, pid %i" % (describe_crnn_version(), os.getpid())
  print >> log.v3, "Theano:", describe_theano_version()
  initFaulthandler()
  if config.value('task', 'train') == "theano_graph":
    config.set("multiprocessing", False)
  if config.bool('multiprocessing', True):
    initCudaNotInMainProcCheck()
  if config.bool('ipython', False):
    initIPythonKernel()
  initConfigJsonNetwork()
  devices = initDevices()
  if needData():
    initData()
  printTaskProperties(devices)
  initEngine(devices)
Example #3
0
def init(configFilename=None,
         commandLineOptions=(),
         config_updates=None,
         extra_greeting=None):
    """
  :param str|None configFilename:
  :param tuple[str]|list[str]|None commandLineOptions:
  :param dict[str]|None config_updates:
  :param str|None extra_greeting:
  """
    initBetterExchook()
    initThreadJoinHack()
    initConfig(configFilename=configFilename,
               commandLineOptions=commandLineOptions)
    if config_updates:
        config.update(config_updates)
    initLog()
    if extra_greeting:
        print(extra_greeting, file=log.v1)
    crnnGreeting(configFilename=configFilename,
                 commandLineOptions=commandLineOptions)
    initBackendEngine()
    initFaulthandler()
    if BackendEngine.is_theano_selected():
        if config.value('task', 'train') == "theano_graph":
            config.set("multiprocessing", False)
        if config.bool('multiprocessing', True):
            initCudaNotInMainProcCheck()
    if config.bool('ipython', False):
        initIPythonKernel()
    initConfigJsonNetwork()
    devices = initDevices()
    if needData():
        initData()
    printTaskProperties(devices)
    if config.value('task', 'train') == 'server':
        server = Server.Server(config)
    else:
        initEngine(devices)
Example #4
0
def init(configFilename=None, commandLineOptions=()):
    initBetterExchook()
    initThreadJoinHack()
    initConfig(configFilename=configFilename,
               commandLineOptions=commandLineOptions)
    initLog()
    crnnGreeting()
    initBackendEngine()
    initFaulthandler()
    if BackendEngine.is_theano_selected():
        if config.value('task', 'train') == "theano_graph":
            config.set("multiprocessing", False)
        if config.bool('multiprocessing', True):
            initCudaNotInMainProcCheck()
    if config.bool('ipython', False):
        initIPythonKernel()
    initConfigJsonNetwork()
    devices = initDevices()
    if needData():
        initData()
    printTaskProperties(devices)
    initEngine(devices)