Products
GG网络技术分享 2025-11-13 09:27 2
根据您给的文档内容,
检查Python版本

python --version 检查Python版本是不是在2.x或3.x之间。安装pip
sudo apt-get install python-pip 安装pip包管理工具这个。编写测试脚本
test.py 的Python脚本, 内容如下:
python
print
运行测试脚本
python test.py 运行脚本,Ru果输出“Hello, TensorFlow!”,则表示Python周围正常。安装OpenSSL开发包
sudo apt-get install libssl-dev 安装OpenSSL开发包。安装Python周围
用pip安装TensorFlow
bash
pip install tensorflow
bash
pip install tensorflow-cpu
从源代码编译安装TensorFlow
bash
git clone https://github.com/tensorflow/tensorflow
bash
sudo apt-get install python-numpy python-dev python-pip python-wheels
sudo apt-get install bazel
sudo apt-get install protobuf-compiler
bash
cd tensorflow
./configure
bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
sudo pip install /tmp/tensorflow_pkg/tensorflow-version-tags.whl
测试TensorFlow安装
python
import tensorflow as tf
hello = tf.constant
sess = tf.Session
print)
请按照上述步骤逐步进行,以确保TensorFlowNeng正确安装并运行。
Demand feedback