TensorFlow 1.15.5编译安装完成后使用自带样例进行基本功能的验证。本文使用自带样例中的图像识别样例来验证TensorFlow的基本功能。
1 | python3 -c "import tensorflow as tf; print(tf.__version__)" |
回显信息显示,版本号为1.15.5。
以TensorFlow自带样例图像识别为例。
1 | cd /path/to/tensorflow |
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 |
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类别的概率最大。