1、基本介绍
- TensorFlow is an end-to-end open source platform for machine learning. It has a comprehensive, flexible ecosystem of tools, libraries, and community resources that lets researchers push the state-of-the-art in ML and developers easily build and deploy ML-powered applications.
- TensorFlow was originally developed by researchers and engineers working on the Google Brain team within Google’s Machine Intelligence Research organization to conduct machine learning and deep neural networks research. The system is general enough to be applicable in a wide variety of other domains, as well.
TensorFlow provides stable Python and C++ APIs, as well as non-guaranteed backward compatible API for other languages.
- python API:https://www.tensorflow.org/api_docs/python
- C++ API:https://www.tensorflow.org/api_docs/cc
- other languages API:https://www.tensorflow.org/api_docs
2、安装、使用
(1)安装
smaller CPU-only package
pip install tensorflow-cpu[==2.5.0] [--upgrade]
- 安装时可指定具体版本
--upgrade
可将当前版本更新至最新版
- support for CUDA-enabled GPU cards
pip install tensorflow[==2.5.0] [--upgrade]
参考:
- 官网安装教程:https://www.tensorflow.org/install
- pip 方式安装:https://www.tensorflow.org/install/pip
- 支持 GPU:https://www.tensorflow.org/install/gpu
- docker 方式安装:https://www.tensorflow.org/install/docker
- 源码安装:https://www.tensorflow.org/install/source
(2)使用测试
import tensorflow as tf
res = tf.add(1, 2).numpy()
# jy: 输出结果: 3
print(res)
hello = tf.constant('Hello, TensorFlow!')
# jy: 输出结果: b'Hello, TensorFlow!'
print(hello.numpy())
3、参考链接
- 官网安装教程:https://www.tensorflow.org/install
- 官方 github:https://github.com/tensorflow/tensorflow
- 官网文档:https://www.tensorflow.org/tutorials/
- TensorFlow Official Models:https://github.com/tensorflow/models/tree/master/official
- TensorFlow Examples:https://github.com/tensorflow/examples
- TensorFlow model optimization roadmap
- TensorBoard Visualization Toolkit:https://github.com/tensorflow/tensorboard
- TensorFlow Blog:https://blog.tensorflow.org/
- 其它教程