TensorFlow 从入门到精通(一):安装和使用

  • 安装过程
    • 源码编译安装
    • PIP 安装
      • 安装 PIP
      • 安装 TensorFlow 071
      • 安装 TensorFlow 080rc
    • Docker 镜像安装
    • Virtual Env 安装
  • 使用过程
    • K40 上运行输出
    • M40 上运行输出
  • 注意事项

安装过程

TensorFlow 支持以下几种安装方式:

  • 源码编译安装
  • PIP 安装
  • Docker 镜像安装
  • Virtual Env 安装

源码编译安装

  • 下载源码
    $ git clone --recurse-submodules https://github.com/tensorflow/tensorflow
  • 安装 Bazel
    参考 http://bazel.io/docs/install.html
  • 配置
    $ ./configure
  • 编译
    仅 CPU 支持,无 GPU 支持:
    $ bazel build -c opt //tensorflow/tools/pip_package:build_pip_package
    有 GPU 支持:
    $ bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
  • 生成 pip 安装包
    $ bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
  • 使用 PIP 工具安装
    $ pip install /tmp/tensorflow_pkg/tensorflow-0.7.1-py2-none-linux_x86_64.whl

PIP 安装

PIP 是一种包管理系统,用于安装和管理用 Python 写的软件包。 —— [ Python PIP ]

安装 PIP

# Ubuntu/Linux 64-bit
$ sudo apt-get install python-pip python-dev

# CentOS, Fedora, RHEL
$ sudo yum install python-pip python-devel

# Mac OS X
$ sudo easy_install pip

以下两个版本,读者可以任选其一。其中 0.8.0rc 开始支持多机多卡分布式计算,而之前的版本只支持单计算节点。

安装 TensorFlow 0.7.1

# CPU 版本:
$ sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.7.1-cp27-none-linux_x86_64.whl

# GPU 版本:
$ sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.7.1-cp27-none-linux_x86_64.whl

安装 TensorFlow 0.8.0rc

# CPU 版本:
$ sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0rc0-cp27-none-linux_x86_64.whl

# GPU 版本:
$ pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.8.0rc0-cp27-none-linux_x86_64.whl

注意:如果你从旧的 TensorFlow 版本( < 0.7.1 )升级,你应该首先使用 pip uninstall 卸载掉旧的 TensorFlow 和 protobuf ,保证环境是干净的。

运行记录如下:

# pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.8.0rc0-cp27-none-linux_x86_64.whl
You are using pip version 7.1.0, however version 8.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting tensorflow==0.8.0rc0 from https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.8.0rc0-cp27-none-linux_x86_64.whl
  Downloading https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.8.0rc0-cp27-none-linux_x86_64.whl (86.7MB)
    100% |████████████████████████████████| 86.7MB 4.9kB/s
Collecting six>=1.10.0 (from tensorflow==0.8.0rc0)
  Downloading six-1.10.0-py2.py3-none-any.whl
Collecting protobuf==3.0.0b2 (from tensorflow==0.8.0rc0)
  Downloading protobuf-3.0.0b2-py2.py3-none-any.whl (326kB)
    100% |████████████████████████████████| 327kB 89kB/s
Collecting wheel (from tensorflow==0.8.0rc0)
  Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
    100% |████████████████████████████████| 69kB 102kB/s
Collecting numpy>=1.8.2 (from tensorflow==0.8.0rc0)
  Downloading numpy-1.11.0.tar.gz (4.2MB)
    100% |████████████████████████████████| 4.2MB 50kB/s
Collecting setuptools (from protobuf==3.0.0b2->tensorflow==0.8.0rc0)
  Downloading setuptools-20.9.0-py2.py3-none-any.whl (508kB)
    100% |████████████████████████████████| 512kB 43kB/s
Installing collected packages: six, setuptools, protobuf, wheel, numpy, tensorflow
  Found existing installation: six 1.9.0
    Uninstalling six-1.9.0:
      Successfully uninstalled six-1.9.0
  Found existing installation: setuptools 0.9.8
    Uninstalling setuptools-0.9.8:
      Successfully uninstalled setuptools-0.9.8
  Found existing installation: numpy 1.7.1
    DEPRECATION: Uninstalling a distutils installed project (numpy) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
    Uninstalling numpy-1.7.1:
      Successfully uninstalled numpy-1.7.1
  Running setup.py install for numpy
^^^^^^Successfully installed numpy-1.11.0 protobuf-3.0.0b2 setuptools-20.9.0 six-1.10.0 tensorflow-0.8.0rc0 wheel-0.29.0

Docker 镜像安装

Docker 是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的 Linux 机器上,也可以实现虚拟化。 —— [ Docker ]

当你通过 Docker 安装和运行 TensorFlow 时,它与你机器上之前已安装的软件包完全隔离。
官方提供了 4 个 Docker 镜像可供使用:

  • 仅 CPU 版,无开发环境:gcr.io/tensorflow/tensorflow
  • 仅 CPU 版,有开发环境:gcr.io/tensorflow/tensorflow:latest-devel
  • 支持 GPU,无开发环境:gcr.io/tensorflow/tensorflow:latest-gpu
  • 支持 GPU,有开发环境:gcr.io/tensorflow/tensorflow:latest-devel-gpu

另外提供了对应某个发布版本的镜像,只需将上面 tag 中 latest 替换为发布版本号(如 0.8.0rc0-gpu)。安装详细步骤如下:

创建 Docker 用户组,允许普通用户无需 sudo 即可启动容器。

$ usermod -a -G docker YOURNAME

选择上述 4 个镜像中的一个,创建容器。第一次执行该命令时会自动下载镜像,以后不需要再次下载。

$ docker run -it gcr.io/tensorflow/tensorflow

如果你使用了支持 GPU 的容器,在运行该命令时需要增加额外参数,目的是将宿主机上的 GPU 设备暴露给容器。使用 TensorFlow 源码中提供的脚本可以实现该功能

$ cd $TENSORFLOW_ROOT/tensorflow/tools/docker/
$ ./docker_run_gpu.sh gcr.io/tensorflow/tensorflow:gpu

好奇心驱使我们查看该脚本的具体细节:

#!/usr/bin/env bash
# Copyright 2015 Google Inc. 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.
# ==============================================================================


set -e

export CUDA_HOME=${CUDA_HOME:-/usr/local/cuda}

if [ ! -d ${CUDA_HOME}/lib64 ]; then
  echo "Failed to locate CUDA libs at ${CUDA_HOME}/lib64."
  exit 1
fi

export CUDA_SO=$(\ls /usr/lib/x86_64-linux-gnu/libcuda.* | \
                    xargs -I{} echo '-v {}:{}')
export DEVICES=$(\ls /dev/nvidia* | \
                    xargs -I{} echo '--device {}:{}')

if [[ "${DEVICES}" = "" ]]; then
  echo "Failed to locate NVidia device(s). Did you want the non-GPU container?"
  exit 1
fi

docker run -it $CUDA_SO $DEVICES "$@"

主要做了几件事:

  • 暴露宿主机的 CUDA_HOME 环境变量给容器使用;
  • 暴露宿主机的 libcuda.* 动态链接库给容器访问;
  • 暴露宿主机的 /dev/nvidia* 设备给容器访问;

Virtual Env 安装

占位待更

使用过程

假设读者已经按照上述步骤安装了 GPU 版本 TensorFlow 0.8.0rc,接下来可以运行经典例程(MNIST):

# python -m tensorflow.models.image.mnist.convolutional

K40 上运行输出

# python -m tensorflow.models.image.mnist.convolutional
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcudnn.so locally
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcurand.so locally
Extracting data/train-images-idx3-ubyte.gz
Extracting data/train-labels-idx1-ubyte.gz
Extracting data/t10k-images-idx3-ubyte.gz
Extracting data/t10k-labels-idx1-ubyte.gz
I tensorflow/core/common_runtime/gpu/gpu_init.cc:102] Found device 0 with properties:
name: Tesla K40m
major: 3 minor: 5 memoryClockRate (GHz) 0.745
pciBusID 0000:02:00.0
Total memory: 11.25GiB
Free memory: 10.88GiB
I tensorflow/core/common_runtime/gpu/gpu_init.cc:102] Found device 1 with properties:
name: Tesla K40m
major: 3 minor: 5 memoryClockRate (GHz) 0.745
pciBusID 0000:03:00.0
Total memory: 11.25GiB
Free memory: 11.07GiB
I tensorflow/core/common_runtime/gpu/gpu_init.cc:126] DMA: 0 1
I tensorflow/core/common_runtime/gpu/gpu_init.cc:136] 0:   Y Y
I tensorflow/core/common_runtime/gpu/gpu_init.cc:136] 1:   Y Y
I tensorflow/core/common_runtime/gpu/gpu_device.cc:717] Creating TensorFlow device (/gpu:0) -> (device: 0, name: Tesla K40m, pci bus id: 0000:02:00.0)
I tensorflow/core/common_runtime/gpu/gpu_device.cc:717] Creating TensorFlow device (/gpu:1) -> (device: 1, name: Tesla K40m, pci bus id: 0000:03:00.0)
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 1.0KiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 2.0KiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 4.0KiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 8.0KiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 16.0KiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 32.0KiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 64.0KiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 128.0KiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 256.0KiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 512.0KiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 1.00MiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 2.00MiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 4.00MiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 8.00MiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 16.00MiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 32.00MiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 64.00MiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 128.00MiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 256.00MiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 512.00MiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 1.00GiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 2.00GiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 4.00GiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 8.00GiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 16.00GiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 1.0KiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 2.0KiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 4.0KiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 8.0KiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 16.0KiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 32.0KiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 64.0KiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 128.0KiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 256.0KiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 512.0KiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 1.00MiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 2.00MiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 4.00MiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 8.00MiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 16.00MiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 32.00MiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 64.00MiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 128.00MiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 256.00MiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 512.00MiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 1.00GiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 2.00GiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 4.00GiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 8.00GiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:51] Creating bin of max chunk size 16.00GiB
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:73] Allocating 10.33GiB bytes.
I tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:83] GPU 0 memory begins at 0x2308f40000 extends to 0x259e37e267
Initialized!
Step 0 (epoch 0.00), 12.6 ms
Minibatch loss: 12.054, learning rate: 0.010000
Minibatch error: 90.6%
Validation error: 84.6%
Step 100 (epoch 0.12), 19.9 ms
Minibatch loss: 3.285, learning rate: 0.010000
Minibatch error: 6.2%
Validation error: 7.1%
Step 200 (epoch 0.23), 19.9 ms
Minibatch loss: 3.469, learning rate: 0.010000
Minibatch error: 14.1%
Validation error: 3.9%
Step 300 (epoch 0.35), 19.8 ms
Minibatch loss: 3.212, learning rate: 0.010000
Minibatch error: 7.8%
Validation error: 3.2%
Step 400 (epoch 0.47), 19.9 ms
Minibatch loss: 3.226, learning rate: 0.010000
Minibatch error: 12.5%
Validation error: 2.7%
Step 500 (epoch 0.58), 20.0 ms
Minibatch loss: 3.300, learning rate: 0.010000
Minibatch error: 9.4%
Validation error: 2.7%
Step 600 (epoch 0.70), 19.9 ms
Minibatch loss: 3.185, learning rate: 0.010000
Minibatch error: 6.2%
Validation error: 2.6%
Step 700 (epoch 0.81), 20.0 ms
Minibatch loss: 2.999, learning rate: 0.010000
Minibatch error: 1.6%
Validation error: 2.5%
Step 800 (epoch 0.93), 19.8 ms
Minibatch loss: 3.060, learning rate: 0.010000
Minibatch error: 6.2%
Validation error: 2.1%
Step 900 (epoch 1.05), 19.7 ms
Minibatch loss: 2.936, learning rate: 0.009500
Minibatch error: 3.1%
Validation error: 1.6%
Step 1000 (epoch 1.16), 19.9 ms
Minibatch loss: 2.855, learning rate: 0.009500
Minibatch error: 0.0%
Validation error: 1.7%
Step 1100 (epoch 1.28), 19.8 ms
Minibatch loss: 2.827, learning rate: 0.009500
Minibatch error: 1.6%
Validation error: 1.6%
Step 1200 (epoch 1.40), 19.8 ms
Minibatch loss: 2.911, learning rate: 0.009500
Minibatch error: 6.2%
Validation error: 1.6%
Step 1300 (epoch 1.51), 19.8 ms
Minibatch loss: 2.767, learning rate: 0.009500
Minibatch error: 0.0%
Validation error: 1.6%
Step 1400 (epoch 1.63), 19.7 ms
Minibatch loss: 2.779, learning rate: 0.009500
Minibatch error: 3.1%
Validation error: 1.6%
Step 1500 (epoch 1.75), 19.8 ms
Minibatch loss: 2.843, learning rate: 0.009500
Minibatch error: 4.7%
Validation error: 1.3%
Step 1600 (epoch 1.86), 20.0 ms
Minibatch loss: 2.699, learning rate: 0.009500
Minibatch error: 0.0%
Validation error: 1.3%
Step 1700 (epoch 1.98), 20.1 ms
Minibatch loss: 2.657, learning rate: 0.009500
Minibatch error: 0.0%
Validation error: 1.5%
Step 1800 (epoch 2.09), 19.9 ms
Minibatch loss: 2.681, learning rate: 0.009025
Minibatch error: 1.6%
Validation error: 1.3%
Step 1900 (epoch 2.21), 20.0 ms
Minibatch loss: 2.651, learning rate: 0.009025
Minibatch error: 1.6%
Validation error: 1.2%
Step 2000 (epoch 2.33), 19.7 ms
Minibatch loss: 2.662, learning rate: 0.009025
Minibatch error: 3.1%
Validation error: 1.4%
Step 2100 (epoch 2.44), 19.9 ms
Minibatch loss: 2.573, learning rate: 0.009025
Minibatch error: 0.0%
Validation error: 1.1%
Step 2200 (epoch 2.56), 19.6 ms
Minibatch loss: 2.577, learning rate: 0.009025
Minibatch error: 1.6%
Validation error: 1.1%
Step 2300 (epoch 2.68), 19.7 ms
Minibatch loss: 2.562, learning rate: 0.009025
Minibatch error: 1.6%
Validation error: 1.1%
Step 2400 (epoch 2.79), 20.0 ms
Minibatch loss: 2.504, learning rate: 0.009025
Minibatch error: 0.0%
Validation error: 1.1%
Step 2500 (epoch 2.91), 19.7 ms
Minibatch loss: 2.468, learning rate: 0.009025
Minibatch error: 0.0%
Validation error: 1.1%
Step 2600 (epoch 3.03), 20.0 ms
Minibatch loss: 2.452, learning rate: 0.008574
Minibatch error: 0.0%
Validation error: 1.2%
Step 2700 (epoch 3.14), 19.7 ms
Minibatch loss: 2.486, learning rate: 0.008574
Minibatch error: 1.6%
Validation error: 1.1%
Step 2800 (epoch 3.26), 19.9 ms
Minibatch loss: 2.415, learning rate: 0.008574
Minibatch error: 1.6%
Validation error: 1.2%
Step 2900 (epoch 3.37), 19.9 ms
Minibatch loss: 2.457, learning rate: 0.008574
Minibatch error: 3.1%
Validation error: 1.2%
Step 3000 (epoch 3.49), 19.7 ms
Minibatch loss: 2.410, learning rate: 0.008574
Minibatch error: 3.1%
Validation error: 1.2%
Step 3100 (epoch 3.61), 19.8 ms
Minibatch loss: 2.396, learning rate: 0.008574
Minibatch error: 3.1%
Validation error: 1.1%
Step 3200 (epoch 3.72), 19.6 ms
Minibatch loss: 2.335, learning rate: 0.008574
Minibatch error: 0.0%
Validation error: 1.1%
Step 3300 (epoch 3.84), 19.8 ms
Minibatch loss: 2.309, learning rate: 0.008574
Minibatch error: 0.0%
Validation error: 1.1%
Step 3400 (epoch 3.96), 19.9 ms
Minibatch loss: 2.297, learning rate: 0.008574
Minibatch error: 0.0%
Validation error: 1.1%
Step 3500 (epoch 4.07), 19.8 ms
Minibatch loss: 2.276, learning rate: 0.008145
Minibatch error: 0.0%
Validation error: 1.0%
Step 3600 (epoch 4.19), 19.8 ms
Minibatch loss: 2.256, learning rate: 0.008145
Minibatch error: 0.0%
Validation error: 0.9%
Step 3700 (epoch 4.31), 19.8 ms
Minibatch loss: 2.231, learning rate: 0.008145
Minibatch error: 0.0%
Validation error: 1.0%
Step 3800 (epoch 4.42), 19.6 ms
Minibatch loss: 2.220, learning rate: 0.008145
Minibatch error: 0.0%
Validation error: 0.9%
Step 3900 (epoch 4.54), 19.8 ms
Minibatch loss: 2.299, learning rate: 0.008145
Minibatch error: 3.1%
Validation error: 1.0%
Step 4000 (epoch 4.65), 19.7 ms
Minibatch loss: 2.225, learning rate: 0.008145
Minibatch error: 1.6%
Validation error: 1.0%
Step 4100 (epoch 4.77), 19.8 ms
Minibatch loss: 2.187, learning rate: 0.008145
Minibatch error: 3.1%
Validation error: 0.9%
Step 4200 (epoch 4.89), 19.7 ms
Minibatch loss: 2.207, learning rate: 0.008145
Minibatch error: 1.6%
^^Validation error: 1.0%
Step 4300 (epoch 5.00), 19.7 ms
Minibatch loss: 2.201, learning rate: 0.007738
Minibatch error: 1.6%
Validation error: 0.9%
Step 4400 (epoch 5.12), 19.8 ms
Minibatch loss: 2.135, learning rate: 0.007738
Minibatch error: 1.6%
Validation error: 1.0%
Step 4500 (epoch 5.24), 19.8 ms
Minibatch loss: 2.160, learning rate: 0.007738
Minibatch error: 1.6%
Validation error: 0.9%
Step 4600 (epoch 5.35), 19.8 ms
Minibatch loss: 2.094, learning rate: 0.007738
Minibatch error: 0.0%
Validation error: 0.9%
Step 4700 (epoch 5.47), 19.7 ms
Minibatch loss: 2.104, learning rate: 0.007738
Minibatch error: 1.6%
Validation error: 0.9%
Step 4800 (epoch 5.59), 19.7 ms
Minibatch loss: 2.049, learning rate: 0.007738
Minibatch error: 0.0%
Validation error: 1.0%
Step 4900 (epoch 5.70), 19.9 ms
Minibatch loss: 2.044, learning rate: 0.007738
Minibatch error: 0.0%
Validation error: 0.9%
Step 5000 (epoch 5.82), 19.7 ms
Minibatch loss: 2.172, learning rate: 0.007738
Minibatch error: 3.1%
Validation error: 1.0%
Step 5100 (epoch 5.93), 19.7 ms
Minibatch loss: 2.010, learning rate: 0.007738
Minibatch error: 0.0%
Validation error: 1.0%
Step 5200 (epoch 6.05), 19.8 ms
Minibatch loss: 2.072, learning rate: 0.007351
Minibatch error: 3.1%
Validation error: 1.0%
Step 5300 (epoch 6.17), 19.8 ms
Minibatch loss: 1.991, learning rate: 0.007351
Minibatch error: 0.0%
Validation error: 0.9%
Step 5400 (epoch 6.28), 19.8 ms
Minibatch loss: 1.958, learning rate: 0.007351
Minibatch error: 0.0%
Validation error: 0.8%
Step 5500 (epoch 6.40), 19.8 ms
Minibatch loss: 1.964, learning rate: 0.007351
Minibatch error: 1.6%
Validation error: 0.9%
Step 5600 (epoch 6.52), 19.6 ms
Minibatch loss: 1.929, learning rate: 0.007351
Minibatch error: 0.0%
Validation error: 0.9%
Step 5700 (epoch 6.63), 19.8 ms
Minibatch loss: 1.914, learning rate: 0.007351
Minibatch error: 0.0%
Validation error: 1.1%
Step 5800 (epoch 6.75), 19.6 ms
Minibatch loss: 1.902, learning rate: 0.007351
Minibatch error: 0.0%
Validation error: 0.9%
Step 5900 (epoch 6.87), 19.8 ms
Minibatch loss: 1.895, learning rate: 0.007351
Minibatch error: 0.0%
Validation error: 0.9%
Step 6000 (epoch 6.98), 19.6 ms
Minibatch loss: 1.878, learning rate: 0.007351
Minibatch error: 0.0%
Validation error: 1.0%
Step 6100 (epoch 7.10), 19.5 ms
Minibatch loss: 1.858, learning rate: 0.006983
Minibatch error: 0.0%
Validation error: 0.9%
Step 6200 (epoch 7.21), 19.7 ms
Minibatch loss: 1.844, learning rate: 0.006983
Minibatch error: 0.0%
Validation error: 0.9%
Step 6300 (epoch 7.33), 19.6 ms
Minibatch loss: 1.846, learning rate: 0.006983
Minibatch error: 1.6%
Validation error: 0.9%
Step 6400 (epoch 7.45), 19.7 ms
Minibatch loss: 1.888, learning rate: 0.006983
Minibatch error: 3.1%
Validation error: 0.8%
Step 6500 (epoch 7.56), 19.6 ms
Minibatch loss: 1.812, learning rate: 0.006983
Minibatch error: 0.0%
Validation error: 0.8%
Step 6600 (epoch 7.68), 19.6 ms
Minibatch loss: 1.833, learning rate: 0.006983
Minibatch error: 1.6%
Validation error: 0.9%
Step 6700 (epoch 7.80), 19.7 ms
Minibatch loss: 1.784, learning rate: 0.006983
Minibatch error: 0.0%
Validation error: 0.8%
Step 6800 (epoch 7.91), 19.7 ms
Minibatch loss: 1.772, learning rate: 0.006983
Minibatch error: 0.0%
Validation error: 1.0%
Step 6900 (epoch 8.03), 19.8 ms
Minibatch loss: 1.762, learning rate: 0.006634
Minibatch error: 0.0%
Validation error: 0.9%
Step 7000 (epoch 8.15), 19.7 ms
Minibatch loss: 1.775, learning rate: 0.006634
Minibatch error: 1.6%
Validation error: 0.8%
Step 7100 (epoch 8.26), 19.7 ms
Minibatch loss: 1.735, learning rate: 0.006634
Minibatch error: 0.0%
Validation error: 0.9%
Step 7200 (epoch 8.38), 19.8 ms
Minibatch loss: 1.741, learning rate: 0.006634
Minibatch error: 0.0%
Validation error: 0.9%
^^Step 7300 (epoch 8.49), 19.6 ms
Minibatch loss: 1.722, learning rate: 0.006634
Minibatch error: 0.0%
Validation error: 0.8%
Step 7400 (epoch 8.61), 19.5 ms
Minibatch loss: 1.703, learning rate: 0.006634
Minibatch error: 0.0%
Validation error: 0.8%
Step 7500 (epoch 8.73), 19.8 ms
Minibatch loss: 1.707, learning rate: 0.006634
Minibatch error: 0.0%
Validation error: 0.8%
Step 7600 (epoch 8.84), 19.6 ms
Minibatch loss: 1.801, learning rate: 0.006634
Minibatch error: 1.6%
Validation error: 0.8%
Step 7700 (epoch 8.96), 19.6 ms
Minibatch loss: 1.666, learning rate: 0.006634
Minibatch error: 0.0%
Validation error: 1.0%
Step 7800 (epoch 9.08), 19.6 ms
Minibatch loss: 1.661, learning rate: 0.006302
Minibatch error: 0.0%
Validation error: 0.9%
Step 7900 (epoch 9.19), 19.5 ms
Minibatch loss: 1.647, learning rate: 0.006302
Minibatch error: 0.0%
Validation error: 0.8%
Step 8000 (epoch 9.31), 19.8 ms
Minibatch loss: 1.662, learning rate: 0.006302
Minibatch error: 0.0%
Validation error: 0.8%
Step 8100 (epoch 9.43), 19.6 ms
Minibatch loss: 1.627, learning rate: 0.006302
Minibatch error: 0.0%
Validation error: 0.8%
Step 8200 (epoch 9.54), 19.7 ms
Minibatch loss: 1.621, learning rate: 0.006302
Minibatch error: 0.0%
Validation error: 0.9%
Step 8300 (epoch 9.66), 19.5 ms
Minibatch loss: 1.609, learning rate: 0.006302
Minibatch error: 0.0%
Validation error: 0.8%
Step 8400 (epoch 9.77), 19.6 ms
Minibatch loss: 1.596, learning rate: 0.006302
Minibatch error: 0.0%
Validation error: 0.8%
Step 8500 (epoch 9.89), 19.6 ms
Minibatch loss: 1.606, learning rate: 0.006302
Minibatch error: 0.0%
Validation error: 0.9%
Test error: 0.8%

M40 上运行输出

# python -m tensorflow.models.image.mnist.convolutional
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcudnn.so locally
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcurand.so locally
Extracting data/train-images-idx3-ubyte.gz
Extracting data/train-labels-idx1-ubyte.gz
Extracting data/t10k-images-idx3-ubyte.gz
Extracting data/t10k-labels-idx1-ubyte.gz
I tensorflow/core/common_runtime/gpu/gpu_init.cc:102] Found device 0 with properties:
name: Tesla M40
major: 5 minor: 2 memoryClockRate (GHz) 1.114
pciBusID 0000:03:00.0
Total memory: 12.00GiB
Free memory: 11.84GiB
I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:900] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
I tensorflow/core/common_runtime/gpu/gpu_init.cc:102] Found device 1 with properties:
name: Tesla M40
major: 5 minor: 2 memoryClockRate (GHz) 1.114
pciBusID 0000:83:00.0
Total memory: 12.00GiB
Free memory: 11.83GiB
I tensorflow/core/common_runtime/gpu/gpu_init.cc:126] DMA: 0 1
I tensorflow/core/common_runtime/gpu/gpu_init.cc:136] 0:   Y Y
I tensorflow/core/common_runtime/gpu/gpu_init.cc:136] 1:   Y Y
I tensorflow/core/common_runtime/gpu/gpu_device.cc:755] Creating TensorFlow device (/gpu:0) -> (device: 0, name: Tesla M40, pci bus id: 0000:03:00.0)
I tensorflow/core/common_runtime/gpu/gpu_device.cc:755] Creating TensorFlow device (/gpu:1) -> (device: 1, name: Tesla M40, pci bus id: 0000:83:00.0)
Initialized!
Step 0 (epoch 0.00), 11.5 ms
Minibatch loss: 12.054, learning rate: 0.010000
Minibatch error: 90.6%
Validation error: 84.6%
Step 100 (epoch 0.12), 7.0 ms
Minibatch loss: 3.296, learning rate: 0.010000
Minibatch error: 4.7%
Validation error: 7.2%
Step 200 (epoch 0.23), 7.0 ms
Minibatch loss: 3.443, learning rate: 0.010000
Minibatch error: 12.5%
Validation error: 3.8%
Step 300 (epoch 0.35), 6.9 ms
Minibatch loss: 3.202, learning rate: 0.010000
Minibatch error: 7.8%
Validation error: 3.3%
Step 400 (epoch 0.47), 6.9 ms
Minibatch loss: 3.221, learning rate: 0.010000
Minibatch error: 6.2%
Validation error: 2.6%
Step 500 (epoch 0.58), 6.9 ms
Minibatch loss: 3.291, learning rate: 0.010000
Minibatch error: 7.8%
Validation error: 2.6%
Step 600 (epoch 0.70), 7.0 ms
Minibatch loss: 3.212, learning rate: 0.010000
Minibatch error: 7.8%
Validation error: 2.4%
Step 700 (epoch 0.81), 6.9 ms
Minibatch loss: 3.013, learning rate: 0.010000
Minibatch error: 4.7%
Validation error: 2.5%
Step 800 (epoch 0.93), 6.9 ms
Minibatch loss: 3.110, learning rate: 0.010000
Minibatch error: 6.2%
Validation error: 2.1%
Step 900 (epoch 1.05), 6.9 ms
Minibatch loss: 2.948, learning rate: 0.009500
Minibatch error: 3.1%
Validation error: 1.7%
Step 1000 (epoch 1.16), 6.9 ms
Minibatch loss: 2.859, learning rate: 0.009500
Minibatch error: 0.0%
Validation error: 1.6%
Step 1100 (epoch 1.28), 6.9 ms
Minibatch loss: 2.821, learning rate: 0.009500
Minibatch error: 0.0%
Validation error: 1.6%
Step 1200 (epoch 1.40), 6.9 ms
Minibatch loss: 2.904, learning rate: 0.009500
Minibatch error: 7.8%
Validation error: 1.5%
Step 1300 (epoch 1.51), 6.9 ms
Minibatch loss: 2.769, learning rate: 0.009500
Minibatch error: 0.0%
Validation error: 1.7%
Step 1400 (epoch 1.63), 6.9 ms
Minibatch loss: 2.768, learning rate: 0.009500
Minibatch error: 1.6%
Validation error: 1.6%
Step 1500 (epoch 1.75), 6.9 ms
Minibatch loss: 2.831, learning rate: 0.009500
Minibatch error: 4.7%
Validation error: 1.3%
Step 1600 (epoch 1.86), 6.9 ms
Minibatch loss: 2.688, learning rate: 0.009500
Minibatch error: 0.0%
Validation error: 1.2%
Step 1700 (epoch 1.98), 6.9 ms
Minibatch loss: 2.650, learning rate: 0.009500
Minibatch error: 0.0%
Validation error: 1.4%
Step 1800 (epoch 2.09), 6.9 ms
Minibatch loss: 2.663, learning rate: 0.009025
Minibatch error: 1.6%
Validation error: 1.4%
Step 1900 (epoch 2.21), 6.9 ms
Minibatch loss: 2.669, learning rate: 0.009025
Minibatch error: 1.6%
Validation error: 1.2%
Step 2000 (epoch 2.33), 6.9 ms
Minibatch loss: 2.641, learning rate: 0.009025
Minibatch error: 3.1%
Validation error: 1.3%
Step 2100 (epoch 2.44), 6.9 ms
Minibatch loss: 2.576, learning rate: 0.009025
Minibatch error: 1.6%
Validation error: 1.1%
Step 2200 (epoch 2.56), 6.9 ms
Minibatch loss: 2.589, learning rate: 0.009025
Minibatch error: 3.1%
Validation error: 1.2%
Step 2300 (epoch 2.68), 6.9 ms
Minibatch loss: 2.569, learning rate: 0.009025
Minibatch error: 3.1%
Validation error: 1.1%
Step 2400 (epoch 2.79), 6.9 ms
Minibatch loss: 2.507, learning rate: 0.009025
Minibatch error: 1.6%
Validation error: 1.2%
Step 2500 (epoch 2.91), 6.9 ms
Minibatch loss: 2.474, learning rate: 0.009025
Minibatch error: 0.0%
Validation error: 1.1%
Step 2600 (epoch 3.03), 6.9 ms
Minibatch loss: 2.449, learning rate: 0.008574
Minibatch error: 0.0%
Validation error: 1.2%
Step 2700 (epoch 3.14), 6.9 ms
Minibatch loss: 2.491, learning rate: 0.008574
Minibatch error: 1.6%
Validation error: 1.1%
Step 2800 (epoch 3.26), 6.9 ms
Minibatch loss: 2.420, learning rate: 0.008574
Minibatch error: 1.6%
Validation error: 1.2%
Step 2900 (epoch 3.37), 6.9 ms
Minibatch loss: 2.459, learning rate: 0.008574
Minibatch error: 3.1%
Validation error: 1.2%
Step 3000 (epoch 3.49), 6.9 ms
Minibatch loss: 2.405, learning rate: 0.008574
Minibatch error: 1.6%
Validation error: 1.1%
Step 3100 (epoch 3.61), 6.9 ms
Minibatch loss: 2.375, learning rate: 0.008574
Minibatch error: 0.0%
Validation error: 1.0%
Step 3200 (epoch 3.72), 6.9 ms
Minibatch loss: 2.330, learning rate: 0.008574
Minibatch error: 0.0%
Validation error: 1.1%
Step 3300 (epoch 3.84), 6.9 ms
Minibatch loss: 2.313, learning rate: 0.008574
Minibatch error: 0.0%
Validation error: 1.1%
Step 3400 (epoch 3.96), 6.9 ms
Minibatch loss: 2.291, learning rate: 0.008574
Minibatch error: 0.0%
Validation error: 1.1%
Step 3500 (epoch 4.07), 6.9 ms
Minibatch loss: 2.277, learning rate: 0.008145
Minibatch error: 0.0%
Validation error: 1.0%
Step 3600 (epoch 4.19), 6.9 ms
Minibatch loss: 2.255, learning rate: 0.008145
Minibatch error: 0.0%
Validation error: 1.0%
Step 3700 (epoch 4.31), 6.9 ms
Minibatch loss: 2.238, learning rate: 0.008145
Minibatch error: 0.0%
Validation error: 1.0%
Step 3800 (epoch 4.42), 6.9 ms
Minibatch loss: 2.224, learning rate: 0.008145
Minibatch error: 0.0%
Validation error: 0.9%
Step 3900 (epoch 4.54), 6.9 ms
Minibatch loss: 2.292, learning rate: 0.008145
Minibatch error: 4.7%
Validation error: 1.0%
Step 4000 (epoch 4.65), 7.0 ms
Minibatch loss: 2.225, learning rate: 0.008145
Minibatch error: 3.1%
Validation error: 1.0%
Step 4100 (epoch 4.77), 7.0 ms
Minibatch loss: 2.171, learning rate: 0.008145
Minibatch error: 0.0%
Validation error: 1.0%
Step 4200 (epoch 4.89), 7.0 ms
Minibatch loss: 2.206, learning rate: 0.008145
Minibatch error: 1.6%
Validation error: 1.0%
Step 4300 (epoch 5.00), 7.0 ms
Minibatch loss: 2.167, learning rate: 0.007738
Minibatch error: 1.6%
Validation error: 0.9%
Step 4400 (epoch 5.12), 6.9 ms
Minibatch loss: 2.157, learning rate: 0.007738
Minibatch error: 3.1%
Validation error: 1.0%
Step 4500 (epoch 5.24), 6.9 ms
Minibatch loss: 2.163, learning rate: 0.007738
Minibatch error: 3.1%
Validation error: 0.9%
Step 4600 (epoch 5.35), 6.9 ms
Minibatch loss: 2.100, learning rate: 0.007738
Minibatch error: 1.6%
Validation error: 0.8%
Step 4700 (epoch 5.47), 6.9 ms
Minibatch loss: 2.088, learning rate: 0.007738
Minibatch error: 1.6%
Validation error: 0.9%
Step 4800 (epoch 5.59), 6.9 ms
Minibatch loss: 2.053, learning rate: 0.007738
Minibatch error: 0.0%
Validation error: 1.0%
Step 4900 (epoch 5.70), 6.9 ms
Minibatch loss: 2.052, learning rate: 0.007738
Minibatch error: 0.0%
Validation error: 1.0%
Step 5000 (epoch 5.82), 6.9 ms
Minibatch loss: 2.148, learning rate: 0.007738
Minibatch error: 3.1%
Validation error: 1.0%
Step 5100 (epoch 5.93), 6.9 ms
Minibatch loss: 2.008, learning rate: 0.007738
Minibatch error: 0.0%
Validation error: 0.9%
Step 5200 (epoch 6.05), 6.9 ms
Minibatch loss: 2.083, learning rate: 0.007351
Minibatch error: 3.1%
Validation error: 0.9%
Step 5300 (epoch 6.17), 6.9 ms
Minibatch loss: 1.989, learning rate: 0.007351
Minibatch error: 0.0%
Validation error: 1.0%
Step 5400 (epoch 6.28), 6.9 ms
Minibatch loss: 1.962, learning rate: 0.007351
Minibatch error: 0.0%
Validation error: 0.9%
Step 5500 (epoch 6.40), 6.9 ms
Minibatch loss: 1.952, learning rate: 0.007351
Minibatch error: 0.0%
Validation error: 0.9%
Step 5600 (epoch 6.52), 6.9 ms
Minibatch loss: 1.926, learning rate: 0.007351
Minibatch error: 0.0%
Validation error: 0.9%
Step 5700 (epoch 6.63), 6.9 ms
Minibatch loss: 1.915, learning rate: 0.007351
Minibatch error: 0.0%
Validation error: 1.0%
Step 5800 (epoch 6.75), 6.9 ms
Minibatch loss: 1.898, learning rate: 0.007351
Minibatch error: 0.0%
Validation error: 0.9%
Step 5900 (epoch 6.87), 6.9 ms
Minibatch loss: 1.890, learning rate: 0.007351
Minibatch error: 0.0%
Validation error: 0.9%
Step 6000 (epoch 6.98), 6.9 ms
Minibatch loss: 1.879, learning rate: 0.007351
Minibatch error: 0.0%
Validation error: 1.0%
Step 6100 (epoch 7.10), 6.9 ms
Minibatch loss: 1.861, learning rate: 0.006983
Minibatch error: 0.0%
Validation error: 0.8%
Step 6200 (epoch 7.21), 6.9 ms
Minibatch loss: 1.843, learning rate: 0.006983
Minibatch error: 0.0%
Validation error: 0.8%
Step 6300 (epoch 7.33), 6.9 ms
Minibatch loss: 1.838, learning rate: 0.006983
Minibatch error: 0.0%
Validation error: 0.9%
Step 6400 (epoch 7.45), 6.9 ms
Minibatch loss: 1.855, learning rate: 0.006983
Minibatch error: 1.6%
Validation error: 0.9%
Step 6500 (epoch 7.56), 6.9 ms
Minibatch loss: 1.807, learning rate: 0.006983
Minibatch error: 0.0%
Validation error: 0.9%
Step 6600 (epoch 7.68), 6.9 ms
Minibatch loss: 1.829, learning rate: 0.006983
Minibatch error: 3.1%
Validation error: 0.9%
Step 6700 (epoch 7.80), 6.9 ms
Minibatch loss: 1.783, learning rate: 0.006983
Minibatch error: 0.0%
Validation error: 0.8%
Step 6800 (epoch 7.91), 6.9 ms
Minibatch loss: 1.771, learning rate: 0.006983
Minibatch error: 0.0%
Validation error: 1.0%
Step 6900 (epoch 8.03), 6.9 ms
Minibatch loss: 1.759, learning rate: 0.006634
Minibatch error: 0.0%
Validation error: 0.9%
Step 7000 (epoch 8.15), 6.9 ms
Minibatch loss: 1.795, learning rate: 0.006634
Minibatch error: 1.6%
Validation error: 0.9%
Step 7100 (epoch 8.26), 6.9 ms
Minibatch loss: 1.737, learning rate: 0.006634
Minibatch error: 0.0%
Validation error: 0.9%
Step 7200 (epoch 8.38), 6.9 ms
Minibatch loss: 1.744, learning rate: 0.006634
Minibatch error: 1.6%
Validation error: 0.9%
Step 7300 (epoch 8.49), 7.0 ms
Minibatch loss: 1.718, learning rate: 0.006634
Minibatch error: 0.0%
Validation error: 0.8%
Step 7400 (epoch 8.61), 6.9 ms
Minibatch loss: 1.700, learning rate: 0.006634
Minibatch error: 0.0%
Validation error: 0.8%
Step 7500 (epoch 8.73), 6.9 ms
Minibatch loss: 1.700, learning rate: 0.006634
Minibatch error: 0.0%
Validation error: 0.8%
Step 7600 (epoch 8.84), 6.9 ms
Minibatch loss: 1.790, learning rate: 0.006634
Minibatch error: 1.6%
Validation error: 0.7%
Step 7700 (epoch 8.96), 6.9 ms
Minibatch loss: 1.668, learning rate: 0.006634
Minibatch error: 0.0%
Validation error: 1.0%
Step 7800 (epoch 9.08), 6.9 ms
Minibatch loss: 1.664, learning rate: 0.006302
Minibatch error: 0.0%
Validation error: 0.8%
Step 7900 (epoch 9.19), 6.9 ms
Minibatch loss: 1.647, learning rate: 0.006302
Minibatch error: 0.0%
Validation error: 0.9%
Step 8000 (epoch 9.31), 6.9 ms
Minibatch loss: 1.667, learning rate: 0.006302
Minibatch error: 0.0%
Validation error: 0.9%
Step 8100 (epoch 9.43), 6.9 ms
Minibatch loss: 1.627, learning rate: 0.006302
Minibatch error: 0.0%
Validation error: 0.9%
Step 8200 (epoch 9.54), 6.9 ms
Minibatch loss: 1.621, learning rate: 0.006302
Minibatch error: 0.0%
Validation error: 0.9%
Step 8300 (epoch 9.66), 6.9 ms
Minibatch loss: 1.607, learning rate: 0.006302
Minibatch error: 0.0%
Validation error: 0.9%
Step 8400 (epoch 9.77), 6.9 ms
Minibatch loss: 1.596, learning rate: 0.006302
Minibatch error: 0.0%
Validation error: 0.8%
Step 8500 (epoch 9.89), 6.9 ms
Minibatch loss: 1.599, learning rate: 0.006302
Minibatch error: 0.0%
Validation error: 0.9%
Test error: 0.8%

注意事项

实测使用cuDNN v3 和 v4 性能几乎一致。
TensorFlow 0.8.0rc 不兼容 cuDNN v5。

你可能感兴趣的:(开源框架,深度学习,tensorflow)