NNI启动失败, 提示ERROR: Restful server start failed!
首先确定系统
如为Linux,尝试以下方法
可能是网络配置有问题。可检查以下问题。
可能需要链接 127.0.0.1 与 localhost。 在 /etc/hosts 中增加 127.0.0.1 localhost。
也可能设置了一些代理。检查环境中是否有如 HTTP_PROXY 或 HTTPS_PROXY 的变量,如果有,则需要取消。
如为Windows,尝试以下方法
pip list
确定nni版本,在2.4中有bug导致restful服务器启动失败,该bug已在2.5版本中被修复
故:
回退2.3版本
python -m pip install --upgrade nni==2.3
或者在GitHub中下载最新的2.5版本并安装
异常栈:
INFO: Starting restful server...
ERROR: Restful server start failed!
INFO: Stdout:
-----------------------------------------------------------------------
Experiment start time 2022-01-10 10:58:55
-----------------------------------------------------------------------
INFO: Stderr:
-----------------------------------------------------------------------
Experiment start time 2022-01-10 10:58:55
-----------------------------------------------------------------------
Failed to create log dir: RangeError: Invalid time value
at Date.toISOString (<anonymous>)
at Logger.log (c:\users\go\.conda\envs\py38\lib\site-packages\nni_node\common\log.js:54:72)
at Logger.error (c:\users\go\.conda\envs\py38\lib\site-packages\nni_node\common\log.js:41:14)
at c:\users\go\.conda\envs\py38\lib\site-packages\nni_node\main.js:109:33
Traceback (most recent call last):
File "c:\users\go\.conda\envs\py38\lib\site-packages\psutil\_pswindows.py", line 679, in wrapper
return fun(self, *args, **kwargs)
File "c:\users\go\.conda\envs\py38\lib\site-packages\psutil\_pswindows.py", line 933, in create_time
user, system, created = cext.proc_times(self.pid)
ProcessLookupError: [Errno 3] assume no such process (originated from GetExitCodeProcess != STILL_ACTIVE)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\go\.conda\envs\py38\lib\site-packages\psutil\__init__.py", line 354, in _init
self.create_time()
File "c:\users\go\.conda\envs\py38\lib\site-packages\psutil\__init__.py", line 710, in create_time
self._create_time = self._proc.create_time()
File "c:\users\go\.conda\envs\py38\lib\site-packages\psutil\_pswindows.py", line 681, in wrapper
raise convert_oserror(err, pid=self.pid, name=self._name)
psutil.NoSuchProcess: psutil.NoSuchProcess process no longer exists (pid=4028)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\go\.conda\envs\py38\lib\site-packages\nni\tools\nnictl\launcher.py", line 432, in launch_experiment
kill_command(rest_process.pid)
File "c:\users\go\.conda\envs\py38\lib\site-packages\nni\tools\nnictl\command_utils.py", line 37, in kill_command
process = psutil.Process(pid=pid)
File "c:\users\go\.conda\envs\py38\lib\site-packages\psutil\__init__.py", line 326, in __init__
self._init(pid)
File "c:\users\go\.conda\envs\py38\lib\site-packages\psutil\__init__.py", line 367, in _init
raise NoSuchProcess(pid, None, msg)
psutil.NoSuchProcess: psutil.NoSuchProcess no process found with pid 4028
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\go\.conda\envs\py38\lib\site-packages\nni\tools\nnictl\launcher.py", line 525, in create_experiment
launch_experiment(args, config_v2, 'new', experiment_id, 2)
File "c:\users\go\.conda\envs\py38\lib\site-packages\nni\tools\nnictl\launcher.py", line 434, in launch_experiment
raise Exception(ERROR_INFO % 'Rest server stopped!')
TypeError: not all arguments converted during string formatting
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\go\.conda\envs\py38\lib\site-packages\psutil\_pswindows.py", line 679, in wrapper
return fun(self, *args, **kwargs)
File "c:\users\go\.conda\envs\py38\lib\site-packages\psutil\_pswindows.py", line 933, in create_time
user, system, created = cext.proc_times(self.pid)
ProcessLookupError: [Errno 3] assume no such process (originated from GetExitCodeProcess != STILL_ACTIVE)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\go\.conda\envs\py38\lib\site-packages\psutil\__init__.py", line 354, in _init
self.create_time()
File "c:\users\go\.conda\envs\py38\lib\site-packages\psutil\__init__.py", line 710, in create_time
self._create_time = self._proc.create_time()
File "c:\users\go\.conda\envs\py38\lib\site-packages\psutil\_pswindows.py", line 681, in wrapper
raise convert_oserror(err, pid=self.pid, name=self._name)
psutil.NoSuchProcess: psutil.NoSuchProcess process no longer exists (pid=4028)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\go\.conda\envs\py38\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\users\go\.conda\envs\py38\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\Go\.conda\envs\py38\Scripts\nnictl.exe\__main__.py", line 7, in <module>
File "c:\users\go\.conda\envs\py38\lib\site-packages\nni\tools\nnictl\nnictl.py", line 290, in parse_args
args.func(args)
File "c:\users\go\.conda\envs\py38\lib\site-packages\nni\tools\nnictl\launcher.py", line 529, in create_experiment
kill_command(restServerPid)
File "c:\users\go\.conda\envs\py38\lib\site-packages\nni\tools\nnictl\command_utils.py", line 37, in kill_command
process = psutil.Process(pid=pid)
File "c:\users\go\.conda\envs\py38\lib\site-packages\psutil\__init__.py", line 326, in __init__
self._init(pid)
File "c:\users\go\.conda\envs\py38\lib\site-packages\psutil\__init__.py", line 367, in _init
raise NoSuchProcess(pid, None, msg)
psutil.NoSuchProcess: psutil.NoSuchProcess no process found with pid 4028