Esempio n. 1
0
def _try_stop_remote_run(run, remote_lock, no_wait):
    from guild import plugin as pluginlib  # expensive

    try:
        plugin = pluginlib.for_name(remote_lock.plugin_name)
    except LookupError:
        log.warning(
            "error syncing run '%s': plugin '%s' not available",
            run.id,
            remote_lock.plugin_name,
        )
    else:
        cli.out("Stopping %s (remote)" % run.id, err=True)
        plugin.stop_run(run, dict(no_wait=no_wait))
Esempio n. 2
0
 def python_script_opdef_loaded(self, opdef):
     if opdef.output_scalars is not None:
         return
     assert opdef.main, opdef
     plugin = pluginlib.for_name("python_script")
     main_mod = op_util.split_main(opdef.main)[0]
     model_paths = op_util.opdef_model_paths(opdef)
     try:
         _sys_path, mod_path = plugin.find_module(main_mod, model_paths)
     except ImportError:
         return
     script = python_util.Script(mod_path)
     if self.is_keras_script(script):
         if opdef.output_scalars is None:
             opdef.output_scalars = KERAS_OUTPUT_SCALARS
Esempio n. 3
0
 def python_script_opdef(self, op):
     if (op.compare is not None and op.output_scalars is not None):
         return
     assert op.main, op
     plugin = pluginlib.for_name("python_script")
     main_mod = op_util.split_main(op.main)[0]
     model_paths = op_util.opdef_model_paths(op)
     try:
         _sys_path, mod_path = plugin.find_module(main_mod, model_paths)
     except ImportError:
         return
     script = python_util.Script(mod_path)
     if self.is_keras_script(script):
         if op.compare is None:
             flags = ["=%s" % f.name for f in op.flags]
             op.compare = flags + KERAS_BASE_COMPARE
         if op.output_scalars is None:
             op.output_scalars = KERAS_OUTPUT_SCALARS
Esempio n. 4
0
def _plugin_for_name(name):
    from guild import plugin  # expensive

    return plugin.for_name(name)
Esempio n. 5
0
 def _flags_data(self):
     _log_flags_info("### Script flags for %s", os.path.normpath(self.script_path))
     plugin = pluginlib.for_name("python_script")
     return plugin._flags_data_for_path(self.script_path, "", ".")
Esempio n. 6
0
 def _flags_data(self):
     plugin = pluginlib.for_name("python_script")
     return plugin.flags_data_for_path(self.script_path, ".")