将作业输出数据挂载为Floydhub中另一个作业的输入数据

时间:2019-04-15 22:23:22

标签: python floydhub

我正在尝试遵循文档hereherehere的要求,以使Floydhub使用作业的输出作为另一个作业的输入数据。第一项和第二项工作与2个不同的项目有关。

无法找到我的文件。

No such file or directory: '/output/lemmatized_json.json'

项目1:

该项目在脚本末尾输出数据。

import os
if not os.path.exists('output'):
    os.makedirs('output')

with open('output/lemmatized_json.json', 'w') as out_file:
    json.dump(data, out_file)    

然后在该项目的/files内部可用

enter image description here

/output目录中。

enter image description here

项目2:

现在,我运行第二个项目,以访问以前保存的数据。

我运行项目。

floyd run --cpu2 --env default \
--data me/projects/lemmatize-json-positions/6/:model \
--message 'train embedding' 'python train_embedding.py'

并尝试使用以下代码访问其中的数据。

file = open('/output/lemmatized_json.json') 

但是我得到了上面的错误No such file or directory: 'No such file or directory: '/output/lemmatized_json.json'

我不确定我缺少什么。

1 个答案:

答案 0 :(得分:0)

我只需要

json.dump()
相关问题