简体   繁体   English

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

[英]What am I doing wrong in this Python example code from GitHub?

I am trying to run the quickstart examples from this code on GitHub: https://github.com/brain-research/deep-molecular-massspec 我正在尝试在GitHub上运行以下代码的快速入门示例: https//github.com/brain-research/deep-molecular-massspec

I've downloaded and unzipped the library. 我已经下载并解压缩了库。 Then I open a Bash terminal in that folder, copy each line from the quickstart example and hit enter: 然后,我在该文件夹中打开一个Bash终端,复制快速入门示例中的每一行,然后按Enter键:

TARGET_PATH_NAME=/tmp/massspec_predictions

Then: 然后:

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

This gives the following error. 这给出了以下错误。

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

The temp files don't seem to be being created. 临时文件似乎没有被创建。 I'm not sure why this is. 我不确定为什么会这样。 Can someone smarter than me explain why this is and how to resolve it? 能比我聪明的人解释这是为什么以及如何解决吗?

It looks like massspec_predictions is missing. 看来massspec_predictions丢失了。 Create the folder at /tmp/massspec_predictions . /tmp/massspec_predictions创建文件夹。 You can do this straight from the terminal: 您可以直接从终端执行此操作:

mkdir /tmp/massspec_predictions

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM