Tensorflow download_and_convert_mnist_m.py没有这样的文件或目录:'〜/ dsn_data / mnist_m / mnist_m_train'

时间:2018-03-08 19:06:32

标签: python tensorflow mnist

我使用github https://github.com/tensorflow/models/tree/master/research/domain_adaptation/datasets中的download_and_convert_mnist_m.py脚本发出了一条奇怪的错误消息。

我在models / research /文件夹中使用的命令是

python domain_adaptation/datasets/download_and_convert_mnist_m.py --dataset_dir=~/dsn_data/

错误消息是

Traceback (most recent call last):
  File "domain_adaptation/datasets/download_and_convert_mnist_m.py", line 237, in <module>
    tf.app.run()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "domain_adaptation/datasets/download_and_convert_mnist_m.py", line 233, in main
    run(FLAGS.dataset_dir)
  File "domain_adaptation/datasets/download_and_convert_mnist_m.py", line 201, in run
    os.path.join(dataset_dir, 'mnist_m', 'mnist_m_train'))
  File "domain_adaptation/datasets/download_and_convert_mnist_m.py", line 177, in _get_filenames
    for filename in os.listdir(dataset_dir):
OSError: [Errno 2] No such file or directory: '~/dsn_data/mnist_m/mnist_m_train'

我试过几种方法:

我用

  • Ubuntu 16.04
  • Python 2.7
  • tensorflow 1.4.1

我还能做什么......看起来很简单,但我没有更多想法。

1 个答案:

答案 0 :(得分:0)

我解决了。正确的命令没有等号。

python domain_adaptation/datasets/download_and_convert_mnist_m.py --dataset_dir=~/dsn_data/