TensorFlow MNIST 问题解决
TensorFlow MNIST 问题解决
一、数据集下载错误
错误:IOError: [Errno socket error] [Errno 101] Network is unreachable
A: 手动下载:
http://yann.lecun.com/exdb/mnist/
下面的四个包
train-images-idx3-ubyte.gz: training set images (9912422 bytes)
train-labels-idx1-ubyte.gz: training set labels (28881 bytes)
t10k-images-idx3-ubyte.gz: test set images (1648877 bytes)
t10k-labels-idx1-ubyte.gz: test set labels (4542 bytes)
B: 将下载到的包拷贝到如下目录(注意新版本已经不是之前的MNIST_data 目录了)
cp *.gz /tmp/tensorflow/mnist/input_data/
二、不能运行
错误: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX0.9166
A: 零时解决办法
mnist_softmax.py 中加入如下代码:
在 import sys 后加入如下代码
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import tensorflow as tf
如果出现如下警告: 'TF_CPP_MIN_LOG_LEVEL' represents the Tensorflow environment variable responsible for logging.
则 在ubuntu 上执行如下:
export TF_CPP_MIN_LOG_LEVEL=2
B: 彻底解决此问题
(1)卸载已安装的tensorflow
sudo pip uninstall tensorflow
(2) 用下面的命令重新编译 tensorflow
GPU & CPU
bazel build -c opt --copt=-march=native --copt=-mfpmath=both --config=cuda -k //tensorflow/tools/pip_package:build_pip_package
仅CPU
bazel build -c opt --copt=-march=native --copt=-mfpmath=both -k //tensorflow/tools/pip_package:build_pip_package
(3)生成安装包
bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
(4) 安装
sudo -H pip install /tmp/tensorflow_pkg/tensorflow-1.4.0-cp27-cp27mu-linux_x86_64.whl
参考:
https://stackoverflow.com/questions/42463594/cpu-instructions-not-compiled-with-tensorflow
三、 安装TensorFlow时出现警告
安装命令:
sudo pip install /tmp/tensorflow_pkg/tensorflow-1.4.0-cp27-cp27mu-linux_x86_64.whl
警告:
The directory '/home/dyufei/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
解决办法:
用sudo -H 命令安装:
sudo -H pip install /tmp/tensorflow_pkg/tensorflow-1.4.0-cp27-cp27mu-linux_x86_64.whl
参考:https://stackoverflow.com/questions/33437798/osx-10-11-1-cant-install-gevent
TensorFlow MNIST 问题解决的更多相关文章
- TensorFlow MNIST(手写识别 softmax)实例运行
TensorFlow MNIST(手写识别 softmax)实例运行 首先要有编译环境,并且已经正确的编译安装,关于环境配置参考:http://www.cnblogs.com/dyufei/p/802 ...
- 学习笔记TF056:TensorFlow MNIST,数据集、分类、可视化
MNIST(Mixed National Institute of Standards and Technology)http://yann.lecun.com/exdb/mnist/ ,入门级计算机 ...
- Mac tensorflow mnist实例
Mac tensorflow mnist实例 前期主要需要安装好tensorflow的环境,Mac 如果只涉及到CPU的版本,推荐使用pip3,傻瓜式安装,一行命令!代码使用python3. 在此附上 ...
- tensorflow MNIST Convolutional Neural Network
tensorflow MNIST Convolutional Neural Network MNIST CNN 包含的几个部分: Weight Initialization Convolution a ...
- tensorflow MNIST新手教程
官方教程代码如下: import gzip import os import tempfile import numpy from six.moves import urllib from six.m ...
- TensorFlow MNIST初级学习
MNIST MNIST 是一个入门级计算机视觉数据集,包含了很多手写数字图片,如图所示: 数据集中包含了图片和对应的标注,在 TensorFlow 中提供了这个数据集,我们可以用如下方法进行导入: f ...
- 学习笔记TF057:TensorFlow MNIST,卷积神经网络、循环神经网络、无监督学习
MNIST 卷积神经网络.https://github.com/nlintz/TensorFlow-Tutorials/blob/master/05_convolutional_net.py .Ten ...
- AI tensorflow MNIST
MNIST 数据 train-images-idx3-ubyte.gz:训练集图片 train-labels-idx1-ubyte.gz:训练集图片类别 t10k-images-idx3-ubyte. ...
- tensorflow——MNIST机器学习入门
将这里的代码在项目中执行下载并安装数据集. 执行下面代码,训练.并评估模型: # _*_coding:utf-8_*_ import inputdata mnist = inputdata.read_ ...
随机推荐
- boost 线程安全队列
threadnullmethodsprocessingobjectsignal // QueueImplementation.cpp : Defines the entry point for the ...
- crontab不能执行sudo:抱歉,您必须拥有一个终端来执行 sudo
最近做一个可执行shell调度的需求,要求用户输入shell,然后后台定时调度运行.实现大致为:保存用户的输入,设定时间,crontab定时执行用户的输入.但这里涉及到一个安全问题,如何确定用户的输入 ...
- gitolite migration to bitbucket
https://gist.github.com/kostajh/9249937 https://designhammer.com/blog/easily-migrate-git-repositorie ...
- .NET “底层”异步编程模式——异步编程模型(Asynchronous Programming Model,APM)
本文内容 异步编程类型 异步编程模型(APM) 参考资料 首先澄清,异步编程模式(Asynchronous Programming Patterns)与异步编程模型(Asynchronous Prog ...
- Machine、Swarm、Compose、SocketPlane这些Docker生态圈软件各解决了哪些问题?
Machine:解决的是操作系统异构安装Docker困难的问题,没有Machine的时候,CentOS是一种,Ubuntu又是一种,AWS又是一种.有了Machine,所有的系统都是一样的安装方式. ...
- Fix Corrupt Blocks on HDFS
来自:http://centoshowtos.org/hadoop/fix-corrupt-blocks-on-hdfs/ How do I know if my hadoop hdfs filesy ...
- 【Zookeeper】源码分析之Leader选举(二)之FastLeaderElection
一.前言 前面学习了Leader选举的总体框架,接着来学习Zookeeper中默认的选举策略,FastLeaderElection. 二.FastLeaderElection源码分析 2.1 类的继承 ...
- elasticsearch 支持中英文搜索和混合搜索
环境: ubuntu16.04 安装: elasticsearch 5.22 1. 第一步,安装java apt-get install default-jre apt-get install def ...
- openssl - 怎么打开POD格式的帮助文件
原文链接: http://zhidao.baidu.com/link?url=47I6A0YGA9FnK6galKZ5sxPSZzFGRdng2qhACb4ToBuhuyMhdrwcYpZmNI28y ...
- 9.6 翻译系列:数据注解之Index特性【EF 6 Code-First系列】
原文链接:https://www.entityframeworktutorial.net/entityframework6/index-attribute-in-code-first.aspx EF ...