我试图用零个参数创建MLproject,如下所示:
name: test
conda_env: conda.yaml
entry_points:
main:
parameters:
command: "python test.py"
出现错误时:
Traceback (most recent call last):
File "/home/ubuntu/.local/bin/mlflow", line 11, in <module>
sys.exit(cli())
File "/home/ubuntu/.local/lib/python2.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/ubuntu/.local/lib/python2.7/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/home/ubuntu/.local/lib/python2.7/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/ubuntu/.local/lib/python2.7/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/ubuntu/.local/lib/python2.7/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/home/ubuntu/.local/lib/python2.7/site-packages/mlflow/cli.py", line 137, in run
run_id=run_id,
File "/home/ubuntu/.local/lib/python2.7/site-packages/mlflow/projects/__init__.py", line 230, in run
use_conda=use_conda, storage_dir=storage_dir, synchronous=synchronous, run_id=run_id)
File "/home/ubuntu/.local/lib/python2.7/site-packages/mlflow/projects/__init__.py", line 85, in _run
project = _project_spec.load_project(work_dir)
File "/home/ubuntu/.local/lib/python2.7/site-packages/mlflow/projects/_project_spec.py", line 40, in load_project
entry_points[name] = EntryPoint(name, parameters, command)
File "/home/ubuntu/.local/lib/python2.7/site-packages/mlflow/projects/_project_spec.py", line 87, in __init__
self.parameters = {k: Parameter(k, v) for (k, v) in parameters.items()}
AttributeError: 'NoneType' object has no attribute 'items'
我是否缺少某些东西或mlflow不允许项目的参数为零?
如果有人想尝试,我也会在https://github.com/sameermahajan/mlflow-try的公共仓库中发布此消息:
mlflow run https://github.com/sameermahajan/mlflow-try.git
答案 0 :(得分:0)
为此,您完全删除了“参数”部分,如下所示:
name: test
conda_env: conda.yaml
entry_points:
main:
command: "python test.py"
(我以为我早些尝试过,但是我尝试了太多不同的方法,可能会错过这一方法)