美文网首页
不能运行fully_connected_feed.py文件

不能运行fully_connected_feed.py文件

作者: _sunnyRain | 来源:发表于2018-04-19 20:30 被阅读0次

由于出现以下错误

所以怀疑是没有运行fully_connected_feed.py文件的问题。


错误:

不能运行fully_connected_feed.py

解决:

把克隆好的mnist数据集放入C:\Users\yyuqi\Anaconda3\Lib\site-packages\tensorflow\tensorflow\examples\tutorials\mnist中

运行python fully_connected_feed.py


又出现错误:

ModuleNotFoundError: No module named 'tensorflow.examples'

解决:

需要在创建的虚拟环境(Anaconda Prompt)中运行。


又出现错误:

C:\Users\yyuqi\Anaconda3\envs\tensorflow\lib\site-packages\h5py\__init__.py:34: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`. from ._conv import register_converters as _register_convertersTraceback (most recent call last): File "fully_connected_feed.py", line 279, in tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)

  File "C:\Users\yyuqi\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\platform\app.py", line 48, in run

    _sys.exit(main(_sys.argv[:1] + flags_passthrough))

  File "fully_connected_feed.py", line 221, in main

    tf.gfile.MakeDirs(FLAGS.log_dir)

  File "C:\Users\yyuqi\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 367, in recursive_create_dir

    pywrap_tensorflow.RecursivelyCreateDir(compat.as_bytes(dirname), status)

  File "C:\Users\yyuqi\Anaconda3\envs\tensorflow\lib\contextlib.py", line 66, in __exit__

    next(self.gen)

  File "C:\Users\yyuqi\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 466, in raise_exception_on_not_ok_status

    pywrap_tensorflow.TF_GetCode(status))

tensorflow.python.framework.errors_impl.NotFoundError: Failed to create a directory: /tmp\tensorflow

其中错误:

File "fully_connected_feed.py", line 279, in tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)

        以上报错原因是tensorflow版本太低。

查看tensorflow版本办法:

        <<< import tensorflow

        <<< tensorflow.__version__

升级tensorflow办法:

        GPU版:pip3 install --upgrade tensorflow-gpu

        CPU版:pip3 install --upgrade tensorflow


更新pip:python -m pip install --upgrade pip


相关文章

网友评论

      本文标题:不能运行fully_connected_feed.py文件

      本文链接:https://www.haomeiwen.com/subject/vfzwkftx.html