You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

tensorlayer_cn.md 150 kB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. TensorLayer3.0是一款兼容多种深度学习框架后端的深度学习库,支持TensorFlow, MindSpore, PaddlePaddle为后端计算引擎。TensorLayer3.0使用方式简单,并且在选定运算后端后能和该后端的算子混合使用。TensorLayer3.0提供了数据处理、模型构建、模型训练等深度学习全流程API,同一套代码可以通过一行代码切换后端,减少框架之间算法迁移需要重构代码的繁琐工作。
  2. ## 一、TensorLayer安装
  3. TensorLayer安装前置条件包括TensorFlow, numpy, matplotlib等,如果你需要使用GPU加速还需要安装CUDA和cuDNN。
  4. ### 1.1 安装后端
  5. TensorLayer支持多种后端,默认为TensorFlow,也支持MindSpore和PaddlePaddle,PaddlePaddle目前只支持少量Layer,后续新版本中会持续更新。
  6. 安装TensorFlow
  7. ```python
  8. pip3 install tensorflow-gpu # GPU version
  9. pip3 install tensorflow # CPU version
  10. ```
  11. 如果你想使用MindSpore后端还需要安装MindSpore1.2.0,下面给出了MindSpore1.2.0GPU版本的安装,如果需要安装CPU或者Ascend可以参考MindSpore官网。
  12. ```python
  13. pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.2.1/MindSpore/gpu/ubuntu_x86/cuda-10.1/mindspore_gpu-1.2.1-cp37-cp37m-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple
  14. ```
  15. 如果想要使用PaddlePaddle后端,还需要安装PaddlePaddle2.0,下面给出了PaddlePaddle2.0GPU版本的安装,其他平台请参考PaddlePaddle官网。
  16. ```python
  17. python -m pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple
  18. ```
  19. ### 1.2 安装TensorLayer
  20. 通过PIP安装稳定版本
  21. ```plain
  22. pip install tensorlayer3
  23. pip install tensorlayer3 -i https://pypi.tuna.tsinghua.edu.cn/simple (faster in China)
  24. ```
  25. 如果要获得最新开发版本可以通过下载源码安装
  26. ```plain
  27. pip3 install git+https://git.openi.org.cn/TensorLayer/tensorlayer3.0.git
  28. ```
  29. ## 二、TensorLayer3.0特性
  30. TensorLayer3.0版本主要设计目标如下,我们将会支持TensorFlow, Pytorch, MindSpore, PaddlePaddle作为计算引擎。在API层提供深度学习模型构建组件(Layers),数据处理(DataFlow), 激活函数(Activations),参数初始化函数,代价函数,模型优化函数以及一些常用操作函数。在最上层我们利用TensorLayer开发了一些例子和预训练模型。

TensorLayer3.0 是一款兼容多种深度学习框架为计算后端的深度学习库。计划兼容TensorFlow, Pytorch, MindSpore, Paddle.