我在GitHub的Python示例代码中怎么了?

时间:2019-05-25 21:18:32

标签: python bash

我正在尝试在GitHub上运行以下代码的快速入门示例:https://github.com/brain-research/deep-molecular-massspec

我已经下载并解压缩了库。然后,我在该文件夹中打开一个Bash终端,复制快速入门示例中的每一行,然后按Enter:

TARGET_PATH_NAME=/tmp/massspec_predictions

然后:

python make_train_test_split.py \
--main_sdf_name=testdata/test_14_mend.sdf 
--replicates_sdf_name=testdata/test_2_mend.sdf 
--output_master_dir=$TARGET_PATH_NAME/spectra_tf_records 
--alsologtostderr

这给出了以下错误。

Traceback (most recent call last):
File "make_train_test_split.py", line 451, in 
app.run(main)
File "/usr/local/lib/python2.7/dist-packages/absl/app.py", line 300, in run
_run_main(main, args)
File "/usr/local/lib/python2.7/dist-packages/absl/app.py", line 251, in _run_main
sys.exit(main(argv))
File "make_train_test_split.py", line 400, in main
tf.gfile.MkDir(FLAGS.output_master_dir)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/lib/io/file_io.py", line 409, in create_dir
create_dir_v2(dirname)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/lib/io/file_io.py", line 427, in create_dir_v2
pywrap_tensorflow.CreateDir(compat.as_bytes(path), status)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/errors_impl.py", line 528, in exit
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.NotFoundError: /tmp/massspec_predictions/spectra_tf_records; No such file or directory

似乎没有创建临时文件。我不确定为什么会这样。能比我聪明的人解释这是为什么以及如何解决吗?

1 个答案:

答案 0 :(得分:2)

似乎缺少massspec_predictions。在/tmp/massspec_predictions上创建文件夹。您可以直接从终端执行此操作:

mkdir /tmp/massspec_predictions