如何使用零参数指定 mlflow MLproject?

How do I specify mlflow MLproject with zero parameters?

我尝试用零参数创建 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 不允许零参数的项目?

我也在我的 public 回购中发布了这个:https://github.com/sameermahajan/mlflow-try 如果有人想尝试:

mlflow run https://github.com/sameermahajan/mlflow-try.git

为此,您完全删除 'parameters' 部分,如下所示:

name: test

conda_env: conda.yaml

entry_points:
  main:
    command: "python test.py"

(我以为我早些时候尝试过,但我尝试了太多不同的方法,可能会错过这个)