系统要求 📊

  • 操作系统: Windows/Linux/macOS
  • Python 版本: 3.7-3.11(推荐 3.9)
  • GPU 支持: NVIDIA 显卡 + CUDA 驱动(可选)

安装方式 🛠️

📦 方法一:使用 pip 安装

pip install tensorflow

👉 查看完整 pip 安装文档

🧰 方法二:从源码编译

  1. 安装 Bazel 构建工具
  2. 克隆 TensorFlow 仓库:
    git clone https://github.com/tensorflow/tensorflow.git
    
  3. 执行编译命令:
    bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
    

🐳 方法三:Docker 容器

docker pull tensorflow/tensorflow:latest

🔗 探索 Docker 部署方案

验证安装 🧪

import tensorflow as tf
print(tf.__version__)

✅ 若输出版本号,表示安装成功!

tensorflow_logo

📌 提示: 安装过程中遇到问题?访问社区支持页面 获取帮助