Tensorflow学习笔记(第二天)-TensorFlow运作方式入门

这篇学习笔记详细记录了作者在尝试运行TensorFlow源码时遇到的问题及解决过程,对于初学者来说是一份宝贵的实战经验。
摘要由CSDN通过智能技术生成

    这部分教程直接给出了源码,以为会很快的跑起来,没想到遇到了许多问题。

第一个错误:
    直接运行给出的实例代码 fully_connected_feed.py
NotFoundError: Failed to create a directory: /tmp\tensorflow; No such file or directory

解决方法:这个是找不到文件,无法创建字典。修改代码中的地址:将下面的红色部分的地址前面加/,或者改为你自己代码位置的地址
 parser.add_argument(
      '--input_data_dir',
      type=str,
      default=os.path.join(os.getenv('TEST_TMPDIR', '/tmp'),
                           ' tensorflow/mnist/input_data'),
      help='Directory to put the input data.'
  )
  parser.add_argument(
      '--log_dir',
      type=str,
      default=os.path.join(os.getenv('TEST_TMPDIR', '/tmp'),
                           ' tensorflow/mnist/logs/fully_connected_feed'),
      help='Directory to put the log data.'
  )
第二个错误:
URLError: <urlopen error [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。>

这个问题是无法访问网址,从而无法获取MINST的数据集

解决办法:下载下MINST数据集,复制到上面的input_data文件夹中
MINST数据集:http://yann.lecun.com/exdb/mnist/
三、代码 full_connected_feed.py

# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
  • 4
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值