0

我正在尝试遵循此处此处此处的文档,以便 Floydhub 将作业的输出用作另一项作业的输入数据。第一份和第二份工作与两个不同的项目有关。

它无法找到我的文件。

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

项目一:

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

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用于该项目,

在此处输入图像描述

/output目录中。

在此处输入图像描述

项目二:

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

我运行这个项目。

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'

而且我不确定我错过了什么。

4

1 回答 1

1

我只是需要,

file = open('/model/output/lemmatized_json.json') 
于 2019-04-15T23:31:49.743 回答