---
title: 运行和验证
description: "TensorFlow 1.15.5编译安装完成后使用自带样例进行基本功能的验证。本文使用自带样例中的图像识别样例来验证TensorFlow的基本功能。"
url: https://www.hikunpeng.com/document/detail/zh/SRA/ecosystemEnable/TensorFlow/kunpengtensorflow_02_0025.html
sourcePath: /source/zh/SRA/ecosystemEnable/TensorFlow/kunpengtensorflow_02_0025.html
indexId: 1054727096c3941793a7369e30fd868af24d85c3e32fcd16ea41578c44e0e06572
---
# 运行和验证

TensorFlow 1.15.5编译安装完成后使用自带样例进行基本功能的验证。本文使用自带样例中的图像识别样例来验证TensorFlow的基本功能。

1. 版本验证，在TensorFlow非源码目录下执行。
  1 python3 -c "import tensorflow as tf; print(tf.__version__)"

  回显信息显示，版本号为1.15.5。

2. 基本功能验证。
以TensorFlow自带样例图像识别为例。

  a. 进入TensorFlow源码编译规划路径。
    1 cd /path/to/tensorflow

  b. 获取模型数据和验证数据。
    1 2 curl -L "https://storage.googleapis.com/download.tensorflow.org/models/inception_v3_2016_08_28_frozen.pb.tar.gz" | tar -C tensorflow/examples/label_image/data -xz wget -P tensorflow/examples/label_image/data/ https://www.tensorflow.org/images/cropped_panda.jpg --no-check-certificate

  c. 执行测试用例。
    1 python3 tensorflow/examples/label_image/label_image.py --image=tensorflow/examples/label_image/data/cropped_panda.jpg

    回显信息显示，将图片“tensorflow/examples/label_image/data/cropped_panda.jpg”识别为giant panda类别的概率最大。

更多测试信息请参见：GitHub网站(https://github.com/tensorflow/tensorflow/blob/v1.15.5/tensorflow/examples/label_image/README.md)。
