我正在尝试通过创建一个非常简单的项目并将其记录下来来学习使用mlflow。
我尝试遵循mlflow的示例,当将main.py作为一个普通的bash命令运行时,我的代码可以正常运行。
我不能使用项目和一个简单的文件通过mlflow命令行界面来运行它。我得到了以下错误。
(rlearning) yair@pc2016:~/reinforced_learning101$ mlflow run src/main.py
2019/05/11 10:21:41 ERROR mlflow.cli: === Could not find main among entry points [] or interpret main as a runnable script. Supported script file extensions: ['.py', '.sh'] ===
(rlearning) yair@pc2016:~/reinforced_learning101$ mlflow run .
2019/05/11 10:40:25 INFO mlflow.projects: === Created directory /tmp/tmpe26oernf for downloading remote URIs passed to arguments of type 'path' ===
2019/05/11 10:40:25 INFO mlflow.projects: === Running command 'source activate mlflow-21497056aed7961402b515847613ed9f950fa9fc && python src/main.py 1.0' in run with ID 'ed51446de4c44903ab891d09cfe10e49' ===
bash: activate: No such file or directory
2019/05/11 10:40:25 ERROR mlflow.cli: === Run (ID 'ed51446de4c44903ab891d09cfe10e49') failed ===不用说,我的main有一个.py后缀。
是否有任何错误导致了此问题?
我的main.py是:
import sys
import gym
import mlflow
if __name__ == '__main__':
env = gym.make("CartPole-v0")
right_percent = float(sys.argv[1]) if len(sys.argv) > 1 else 1.0
with mlflow.start_run():
obs = env.reset()
print(env.action_space)
action = 1 # accelerate right
print(obs)
mlflow.log_param("right percent", right_percent)
mlflow.log_metric("mean score", 1)
mlflow.log_metric("std score", 0)conda_env.yaml
name: rlearning
channels:
- defaults
dependencies:
- python=3.7
- numpy
- pandas
- tensorflow-gpu
- pip:
- mlflow
- gymMLproject
name: reinforced learning
conda_env: files/config/conda_environment.yaml
entry_points:
main:
parameters:
right_percent: {type: float, default: 1.0}
command: "python src/main.py {right_percent}"发布于 2019-05-14 00:38:46
看起来你对conda初始化有问题。只是为了测试,我建议尝试使用--no-conda (在确保之前已经安装了所有库之后)。
所以试试这个:mlflow run . --no-conda
https://stackoverflow.com/questions/56088195
复制相似问题