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.

README.md 10 kB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <a href="https://tensorlayer.readthedocs.io/">
  2. <div align="center">
  3. <img src="img/tl_transparent_logo.png" width="50%" height="30%"/>
  4. </div>
  5. </a>
  6. <!--- [![PyPI Version](https://badge.fury.io/py/tensorlayer.svg)](https://badge.fury.io/py/tensorlayer) --->
  7. <!--- ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/tensorlayer.svg)) --->
  8. ![GitHub last commit (branch)](https://img.shields.io/github/last-commit/tensorlayer/tensorlayer/master.svg)
  9. [![Supported TF Version](https://img.shields.io/badge/TensorFlow-2.0.0%2B-brightgreen.svg)](https://github.com/tensorflow/tensorflow/releases)
  10. [![Documentation Status](https://readthedocs.org/projects/tensorlayer/badge/)](https://tensorlayer.readthedocs.io/)
  11. [![Build Status](https://travis-ci.org/tensorlayer/tensorlayer.svg?branch=master)](https://travis-ci.org/tensorlayer/tensorlayer)
  12. [![Downloads](http://pepy.tech/badge/tensorlayer)](http://pepy.tech/project/tensorlayer)
  13. [![Downloads](https://pepy.tech/badge/tensorlayer/week)](https://pepy.tech/project/tensorlayer/week)
  14. [![Docker Pulls](https://img.shields.io/docker/pulls/tensorlayer/tensorlayer.svg)](https://hub.docker.com/r/tensorlayer/tensorlayer/)
  15. [![Codacy Badge](https://api.codacy.com/project/badge/Grade/d6b118784e25435498e7310745adb848)](https://www.codacy.com/app/tensorlayer/tensorlayer)
  16. <!--- [![CircleCI](https://circleci.com/gh/tensorlayer/tensorlayer/tree/master.svg?style=svg)](https://circleci.com/gh/tensorlayer/tensorlayer/tree/master) --->
  17. <!--- [![Documentation Status](https://readthedocs.org/projects/tensorlayercn/badge/)](https://tensorlayercn.readthedocs.io/)
  18. <!--- [![PyUP Updates](https://pyup.io/repos/github/tensorlayer/tensorlayer/shield.svg)](https://pyup.io/repos/github/tensorlayer/tensorlayer/) --->
  19. [TensorLayer](https://tensorlayer.readthedocs.io) is a novel TensorFlow-based deep learning and reinforcement learning library designed for researchers and engineers. It provides an extensive collection of customizable neural layers to build advanced AI models quickly, based on this, the community open-sourced mass [tutorials](https://github.com/tensorlayer/tensorlayer/blob/master/examples/reinforcement_learning/README.md) and [applications](https://github.com/tensorlayer). TensorLayer is awarded the 2017 Best Open Source Software by the [ACM Multimedia Society](https://twitter.com/ImperialDSI/status/923928895325442049).
  20. This project can also be found at [iHub](https://code.ihub.org.cn/projects/328) and [Gitee](https://gitee.com/organizations/TensorLayer).
  21. # News
  22. 🔥 **3.0.0 will supports multiple backends, such as TensorFlow, MindSpore and more, allowing users to run the code on different hardware like Nvidia-GPU and Huawei-Ascend. We need more people to join the dev team, if you are interested, please email hao.dong@pku.edu.cn**
  23. 🔥 Reinforcement Learning Zoo: [Low-level APIs](https://github.com/tensorlayer/tensorlayer/tree/master/examples/reinforcement_learning) for professional usage, [High-level APIs](https://github.com/tensorlayer/RLzoo) for simple usage, and a corresponding [Springer textbook](http://springer.com/gp/book/9789811540943)
  24. 🔥 [Sipeed Maxi-EMC](https://github.com/sipeed/Maix-EMC): Run TensorLayer models on the **low-cost AI chip** (e.g., K210) (Alpha Version)
  25. <!-- 🔥 [NNoM](https://github.com/majianjia/nnom): Run TensorLayer quantized models on the **MCU** (e.g., STM32) (Coming Soon) -->
  26. # Design Features
  27. TensorLayer is a new deep learning library designed with simplicity, flexibility and high-performance in mind.
  28. - ***Simplicity*** : TensorLayer has a high-level layer/model abstraction which is effortless to learn. You can learn how deep learning can benefit your AI tasks in minutes through the massive [examples](https://github.com/tensorlayer/awesome-tensorlayer).
  29. - ***Flexibility*** : TensorLayer APIs are transparent and flexible, inspired by the emerging PyTorch library. Compared to the Keras abstraction, TensorLayer makes it much easier to build and train complex AI models.
  30. - ***Zero-cost Abstraction*** : Though simple to use, TensorLayer does not require you to make any compromise in the performance of TensorFlow (Check the following benchmark section for more details).
  31. TensorLayer stands at a unique spot in the TensorFlow wrappers. Other wrappers like Keras and TFLearn
  32. hide many powerful features of TensorFlow and provide little support for writing custom AI models. Inspired by PyTorch, TensorLayer APIs are simple, flexible and Pythonic,
  33. making it easy to learn while being flexible enough to cope with complex AI tasks.
  34. TensorLayer has a fast-growing community. It has been used by researchers and engineers all over the world, including those from Peking University,
  35. Imperial College London, UC Berkeley, Carnegie Mellon University, Stanford University, and companies like Google, Microsoft, Alibaba, Tencent, Xiaomi, and Bloomberg.
  36. # Multilingual Documents
  37. TensorLayer has extensive documentation for both beginners and professionals. The documentation is available in
  38. both English and Chinese.
  39. [![English Documentation](https://img.shields.io/badge/documentation-english-blue.svg)](https://tensorlayer.readthedocs.io/)
  40. [![Chinese Documentation](https://img.shields.io/badge/documentation-%E4%B8%AD%E6%96%87-blue.svg)](https://tensorlayercn.readthedocs.io/)
  41. [![Chinese Book](https://img.shields.io/badge/book-%E4%B8%AD%E6%96%87-blue.svg)](http://www.broadview.com.cn/book/5059/)
  42. If you want to try the experimental features on the the master branch, you can find the latest document
  43. [here](https://tensorlayer.readthedocs.io/en/latest/).
  44. # Extensive Examples
  45. You can find a large collection of examples that use TensorLayer in [here](examples/) and the following space:
  46. <a href="https://github.com/tensorlayer/awesome-tensorlayer/blob/master/readme.md" target="\_blank">
  47. <div align="center">
  48. <img src="img/awesome-mentioned.png" width="40%"/>
  49. </div>
  50. </a>
  51. # Getting Start
  52. TensorLayer 2.0 relies on TensorFlow, numpy, and others. To use GPUs, CUDA and cuDNN are required.
  53. Install TensorFlow:
  54. ```bash
  55. pip3 install tensorflow-gpu==2.0.0-rc1 # TensorFlow GPU (version 2.0 RC1)
  56. pip3 install tensorflow # CPU version
  57. ```
  58. Install the stable release of TensorLayer:
  59. ```bash
  60. pip3 install tensorlayer
  61. ```
  62. Install the unstable development version of TensorLayer:
  63. ```bash
  64. pip3 install git+https://github.com/tensorlayer/tensorlayer.git
  65. ```
  66. If you want to install the additional dependencies, you can also run
  67. ```bash
  68. pip3 install --upgrade tensorlayer[all] # all additional dependencies
  69. pip3 install --upgrade tensorlayer[extra] # only the `extra` dependencies
  70. pip3 install --upgrade tensorlayer[contrib_loggers] # only the `contrib_loggers` dependencies
  71. ```
  72. If you are TensorFlow 1.X users, you can use TensorLayer 1.11.0:
  73. ```bash
  74. # For last stable version of TensorLayer 1.X
  75. pip3 install --upgrade tensorlayer==1.11.0
  76. ```
  77. <!---
  78. ## Using Docker
  79. The [TensorLayer containers](https://hub.docker.com/r/tensorlayer/tensorlayer/) are built on top of the official [TensorFlow containers](https://hub.docker.com/r/tensorflow/tensorflow/):
  80. ### Containers with CPU support
  81. ```bash
  82. # for CPU version and Python 2
  83. docker pull tensorlayer/tensorlayer:latest
  84. docker run -it --rm -p 8888:8888 -p 6006:6006 -e PASSWORD=JUPYTER_NB_PASSWORD tensorlayer/tensorlayer:latest
  85. # for CPU version and Python 3
  86. docker pull tensorlayer/tensorlayer:latest-py3
  87. docker run -it --rm -p 8888:8888 -p 6006:6006 -e PASSWORD=JUPYTER_NB_PASSWORD tensorlayer/tensorlayer:latest-py3
  88. ```
  89. ### Containers with GPU support
  90. NVIDIA-Docker is required for these containers to work: [Project Link](https://github.com/NVIDIA/nvidia-docker)
  91. ```bash
  92. # for GPU version and Python 2
  93. docker pull tensorlayer/tensorlayer:latest-gpu
  94. nvidia-docker run -it --rm -p 8888:8888 -p 6006:6006 -e PASSWORD=JUPYTER_NB_PASSWORD tensorlayer/tensorlayer:latest-gpu
  95. # for GPU version and Python 3
  96. docker pull tensorlayer/tensorlayer:latest-gpu-py3
  97. nvidia-docker run -it --rm -p 8888:8888 -p 6006:6006 -e PASSWORD=JUPYTER_NB_PASSWORD tensorlayer/tensorlayer:latest-gpu-py3
  98. ```
  99. --->
  100. # Performance Benchmark
  101. The following table shows the training speeds of [VGG16](http://www.robots.ox.ac.uk/~vgg/research/very_deep/) using TensorLayer and native TensorFlow on a TITAN Xp.
  102. | Mode | Lib | Data Format | Max GPU Memory Usage(MB) |Max CPU Memory Usage(MB) | Avg CPU Memory Usage(MB) | Runtime (sec) |
  103. | :-------: | :-------------: | :-----------: | :-----------------: | :-----------------: | :-----------------: | :-----------: |
  104. | AutoGraph | TensorFlow 2.0 | channel last | 11833 | 2161 | 2136 | 74 |
  105. | | TensorLayer 2.0 | channel last | 11833 | 2187 | 2169 | 76 |
  106. | Graph | Keras | channel last | 8677 | 2580 | 2576 | 101 |
  107. | Eager | TensorFlow 2.0 | channel last | 8723 | 2052 | 2024 | 97 |
  108. | | TensorLayer 2.0 | channel last | 8723 | 2010 | 2007 | 95 |
  109. # Getting Involved
  110. Please read the [Contributor Guideline](CONTRIBUTING.md) before submitting your PRs.
  111. We suggest users to report bugs using Github issues. Users can also discuss how to use TensorLayer in the following slack channel.
  112. <br/>
  113. <a href="https://join.slack.com/t/tensorlayer/shared_invite/enQtODk1NTQ5NTY1OTM5LTQyMGZhN2UzZDBhM2I3YjYzZDBkNGExYzcyZDNmOGQzNmYzNjc3ZjE3MzhiMjlkMmNiMmM3Nzc4ZDY2YmNkMTY" target="\_blank">
  114. <div align="center">
  115. <img src="img/join_slack.png" width="40%"/>
  116. </div>
  117. </a>
  118. <br/>
  119. # Citing TensorLayer
  120. If you find TensorLayer useful for your project, please cite the following paper:
  121. ```
  122. @article{tensorlayer2017,
  123. author = {Dong, Hao and Supratak, Akara and Mai, Luo and Liu, Fangde and Oehmichen, Axel and Yu, Simiao and Guo, Yike},
  124. journal = {ACM Multimedia},
  125. title = {{TensorLayer: A Versatile Library for Efficient Deep Learning Development}},
  126. url = {http://tensorlayer.org},
  127. year = {2017}
  128. }
  129. ```

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