powershell中执行mnist_with_summaries.py时出错:
D:\work\AI\tensorflow-1.1.0\tensorflow\tensorflow\examples\tutorials\mnist> python .\mnist_with_summaries.py
Traceback (most recent call last):
File “.\mnist_with_summaries.py”, line 213, in
tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
File “C:\Users\00000\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\platform\app.py”, line 125, in run
_sys.exit(main(argv))
File “.\mnist_with_summaries.py”, line 185, in main
tf.gfile.MakeDirs(FLAGS.log_dir)
File “C:\Users\00000\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\lib\io\file_io.py”, line 379, in recursive_create_dir
pywrap_tensorflow.RecursivelyCreateDir(compat.as_bytes(dirname), status)
File “C:\Users\00000\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\framework\errors_impl.py”, line 526, in exit
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.NotFoundError: Failed to create a directory: /tmp\tensorflow; No such file or directory
查看源码发现:
log dir用的代码
default=os.path.join(os.getenv(‘TEST_TMPDIR’, ‘/tmp’),
‘tensorflow/mnist/logs/mnist_with_summaries’),
于时建立一个环境变量:TEST_TMPDIR,指定为D:\work\AI\datafolder_mike,
之后执行 python .\mnist_with_summaries.py成功,但有警告如下:
PS D:\work\AI\tensorflow-1.1.0\tensorflow\tensorflow\examples\tutorials\mnist> python .\mnist_with_summaries.py
WARNING:tensorflow:From .\mnist_with_summaries.py:41: read_data_sets (from tensorflow.contrib.learn.python.learn.datasets.mnist) is deprecated and will be removed in a future version.
Instructions for updating:
Please use alternatives such as official/mnist/dataset.py from tensorflow/models.
WARNING:tensorflow:From C:\Users\00000\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\contrib\learn\python\learn\datasets\mnist.py:260: maybe_