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.rst 10 kB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. |TENSORLAYER-LOGO|
  2. |Awesome| |Documentation-EN| |Documentation-CN| |Book-CN| |Downloads|
  3. |PyPI| |PyPI-Prerelease| |Commits-Since| |Python| |TensorFlow|
  4. |Travis| |Docker| |RTD-EN| |RTD-CN| |PyUP| |Docker-Pulls| |Code-Quality|
  5. |JOIN-SLACK-LOGO|
  6. `TensorLayer3 <https://tensorlayer3.readthedocs.io>`__ is a novel supports
  7. multiple backends deep learning and reinforcement learning library designed
  8. for researchers and engineers.
  9. It provides an extensive collection of customizable neural layers to
  10. build advanced AI models quickly, based on this, the community open-sourced
  11. mass `tutorials <https://git.openi.org.cn/TensorLayer/tensorlayer3.0/src/branch/master/examples/basic_tutorials>`__ and
  12. `applications <https://git.openi.org.cn/TensorLayer/tensorlayer3.0/src/branch/master/examples/model_zoo>`__.
  13. TensorLayer is awarded the 2017 Best Open Source Software by the `ACM Multimedia Society <https://twitter.com/ImperialDSI/status/923928895325442049>`__.
  14. This project can also be found at `OpenI <https://git.openi.org.cn/TensorLayer/tensorlayer3.0>`__ and `Gitee <https://gitee.com/organizations/TensorLayer>`__.
  15. Why another deep learning library: TensorLayer
  16. ==============================================
  17. As deep learning practitioners, we have been looking for a library that
  18. can address various development purposes. This library is easy to adopt
  19. by providing diverse examples, tutorials and pre-trained models. Also,
  20. it allow users to easily fine-tune TensorFlow; while being suitable for
  21. production deployment. TensorLayer aims to satisfy all these purposes.
  22. It has three key features:
  23. - **Simplicity** : TensorLayer lifts the low-level dataflow interface
  24. of TensorFlow to *high-level* layers / models. It is very easy to
  25. learn through the rich `example
  26. codes <https://github.com/tensorlayer/awesome-tensorlayer>`__
  27. contributed by a wide community.
  28. - **Flexibility** : TensorLayer APIs are transparent: it does not
  29. mask TensorFlow from users; but leaving massive hooks that help
  30. *low-level tuning* and *deep customization*.
  31. - **Zero-cost Abstraction** : TensorLayer can achieve the *full
  32. power* of TensorFlow. The following table shows the training speeds
  33. of classic models using TensorLayer and native TensorFlow on a Titan
  34. X Pascal GPU.
  35. +---------------+-----------------+-----------------+-----------------+
  36. | | CIFAR-10 | PTB LSTM | Word2Vec |
  37. +===============+=================+=================+=================+
  38. | TensorLayer | 2528 images/s | 18063 words/s | 58167 words/s |
  39. +---------------+-----------------+-----------------+-----------------+
  40. | TensorFlow | 2530 images/s | 18075 words/s | 58181 words/s |
  41. +---------------+-----------------+-----------------+-----------------+
  42. TensorLayer stands at a unique spot in the library landscape. Other
  43. wrapper libraries like Keras and TFLearn also provide high-level
  44. abstractions. They, however, often hide the underlying engine from
  45. users, which make them hard to customize and fine-tune. On the contrary,
  46. TensorLayer APIs are generally flexible and transparent. Users often
  47. find it easy to start with the examples and tutorials, and then dive
  48. into TensorFlow seamlessly. In addition, TensorLayer does not create
  49. library lock-in through native supports for importing components from
  50. Keras, TFSlim and TFLearn.
  51. TensorLayer has a fast growing usage among top researchers and
  52. engineers, from universities like Imperial College London, UC Berkeley,
  53. Carnegie Mellon University, Stanford University, and University of
  54. Technology of Compiegne (UTC), and companies like Google, Microsoft,
  55. Alibaba, Tencent, Xiaomi, and Bloomberg.
  56. Install
  57. =======
  58. TensorLayer has pre-requisites including TensorFlow, numpy, and others. For GPU support, CUDA and cuDNN are required.
  59. The simplest way to install TensorLayer is to use the Python Package Index (PyPI):
  60. .. code:: bash
  61. # for last stable version
  62. pip install --upgrade tensorlayer3
  63. # for latest release candidate
  64. pip install --upgrade --pre tensorlayer3
  65. # if you want to install the additional dependencies, you can also run
  66. pip install --upgrade tensorlayer3[all] # all additional dependencies
  67. pip install --upgrade tensorlayer3[extra] # only the `extra` dependencies
  68. pip install --upgrade tensorlayer3[contrib_loggers] # only the `contrib_loggers` dependencies
  69. Alternatively, you can install the latest or development version by directly pulling from github:
  70. .. code:: bash
  71. pip install https://github.com/tensorlayer/tensorlayer/archive/master.zip
  72. # or
  73. # pip install https://github.com/tensorlayer/tensorlayer/archive/<branch-name>.zip
  74. Using Docker - a ready-to-use environment
  75. -----------------------------------------
  76. The `TensorLayer
  77. containers <https://hub.docker.com/r/tensorlayer/tensorlayer/>`__ are
  78. built on top of the official `TensorFlow
  79. containers <https://hub.docker.com/r/tensorflow/tensorflow/>`__:
  80. Containers with CPU support
  81. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  82. .. code:: bash
  83. # for CPU version and Python 2
  84. docker pull tensorlayer/tensorlayer:latest
  85. docker run -it --rm -p 8888:8888 -p 6006:6006 -e PASSWORD=JUPYTER_NB_PASSWORD tensorlayer/tensorlayer:latest
  86. # for CPU version and Python 3
  87. docker pull tensorlayer/tensorlayer:latest-py3
  88. docker run -it --rm -p 8888:8888 -p 6006:6006 -e PASSWORD=JUPYTER_NB_PASSWORD tensorlayer/tensorlayer:latest-py3
  89. Containers with GPU support
  90. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  91. NVIDIA-Docker is required for these containers to work: `Project
  92. Link <https://github.com/NVIDIA/nvidia-docker>`__
  93. .. code:: bash
  94. # for GPU version and Python 2
  95. docker pull tensorlayer/tensorlayer:latest-gpu
  96. nvidia-docker run -it --rm -p 8888:88888 -p 6006:6006 -e PASSWORD=JUPYTER_NB_PASSWORD tensorlayer/tensorlayer:latest-gpu
  97. # for GPU version and Python 3
  98. docker pull tensorlayer/tensorlayer:latest-gpu-py3
  99. nvidia-docker run -it --rm -p 8888:8888 -p 6006:6006 -e PASSWORD=JUPYTER_NB_PASSWORD tensorlayer/tensorlayer:latest-gpu-py3
  100. Contribute
  101. ==========
  102. Please read the `Contributor
  103. Guideline <https://github.com/tensorlayer/tensorlayer/blob/master/CONTRIBUTING.md>`__
  104. before submitting your PRs.
  105. Cite
  106. ====
  107. If you find this project useful, we would be grateful if you cite the
  108. TensorLayer papers.
  109. ::
  110. @article{tensorlayer2017,
  111. author = {Dong, Hao and Supratak, Akara and Mai, Luo and Liu, Fangde and Oehmichen, Axel and Yu, Simiao and Guo, Yike},
  112. journal = {ACM Multimedia},
  113. title = {{TensorLayer: A Versatile Library for Efficient Deep Learning Development}},
  114. url = {http://tensorlayer.org},
  115. year = {2017}
  116. }
  117. ::
  118. @inproceedings{tensorlayer2021,
  119. title={Tensorlayer 3.0: A Deep Learning Library Compatible With Multiple Backends},
  120. author={Lai, Cheng and Han, Jiarong and Dong, Hao},
  121. booktitle={2021 IEEE International Conference on Multimedia \& Expo Workshops (ICMEW)},
  122. pages={1--3},
  123. year={2021},
  124. organization={IEEE}
  125. }
  126. License
  127. =======
  128. TensorLayer is released under the Apache 2.0 license.
  129. .. |TENSORLAYER-LOGO| image:: https://raw.githubusercontent.com/tensorlayer/tensorlayer/master/img/tl_transparent_logo.png
  130. :target: https://tensorlayer.readthedocs.io/
  131. .. |JOIN-SLACK-LOGO| image:: https://raw.githubusercontent.com/tensorlayer/tensorlayer/master/img/join_slack.png
  132. :target: https://join.slack.com/t/tensorlayer/shared_invite/enQtMjUyMjczMzU2Njg4LWI0MWU0MDFkOWY2YjQ4YjVhMzI5M2VlZmE4YTNhNGY1NjZhMzUwMmQ2MTc0YWRjMjQzMjdjMTg2MWQ2ZWJhYzc
  133. .. |Awesome| image:: https://awesome.re/mentioned-badge.svg
  134. :target: https://github.com/tensorlayer/awesome-tensorlayer
  135. .. |Documentation-EN| image:: https://img.shields.io/badge/documentation-english-blue.svg
  136. :target: https://tensorlayer.readthedocs.io/
  137. .. |Documentation-CN| image:: https://img.shields.io/badge/documentation-%E4%B8%AD%E6%96%87-blue.svg
  138. :target: https://tensorlayercn.readthedocs.io/
  139. .. |Book-CN| image:: https://img.shields.io/badge/book-%E4%B8%AD%E6%96%87-blue.svg
  140. :target: http://www.broadview.com.cn/book/5059/
  141. .. |Downloads| image:: http://pepy.tech/badge/tensorlayer
  142. :target: http://pepy.tech/project/tensorlayer
  143. .. |PyPI| image:: http://ec2-35-178-47-120.eu-west-2.compute.amazonaws.com/github/release/tensorlayer/tensorlayer.svg?label=PyPI%20-%20Release
  144. :target: https://pypi.org/project/tensorlayer/
  145. .. |PyPI-Prerelease| image:: http://ec2-35-178-47-120.eu-west-2.compute.amazonaws.com/github/release/tensorlayer/tensorlayer/all.svg?label=PyPI%20-%20Pre-Release
  146. :target: https://pypi.org/project/tensorlayer/
  147. .. |Commits-Since| image:: http://ec2-35-178-47-120.eu-west-2.compute.amazonaws.com/github/commits-since/tensorlayer/tensorlayer/latest.svg
  148. :target: https://github.com/tensorlayer/tensorlayer/compare/1.10.1...master
  149. .. |Python| image:: http://ec2-35-178-47-120.eu-west-2.compute.amazonaws.com/pypi/pyversions/tensorlayer.svg
  150. :target: https://pypi.org/project/tensorlayer/
  151. .. |TensorFlow| image:: https://img.shields.io/badge/tensorflow-1.6.0+-blue.svg
  152. :target: https://github.com/tensorflow/tensorflow/releases
  153. .. |Travis| image:: http://ec2-35-178-47-120.eu-west-2.compute.amazonaws.com/travis/tensorlayer/tensorlayer/master.svg?label=Travis
  154. :target: https://travis-ci.org/tensorlayer/tensorlayer
  155. .. |Docker| image:: http://ec2-35-178-47-120.eu-west-2.compute.amazonaws.com/circleci/project/github/tensorlayer/tensorlayer/master.svg?label=Docker%20Build
  156. :target: https://circleci.com/gh/tensorlayer/tensorlayer/tree/master
  157. .. |RTD-EN| image:: http://ec2-35-178-47-120.eu-west-2.compute.amazonaws.com/readthedocs/tensorlayer/latest.svg?label=ReadTheDocs-EN
  158. :target: https://tensorlayer.readthedocs.io/
  159. .. |RTD-CN| image:: http://ec2-35-178-47-120.eu-west-2.compute.amazonaws.com/readthedocs/tensorlayercn/latest.svg?label=ReadTheDocs-CN
  160. :target: https://tensorlayercn.readthedocs.io/
  161. .. |PyUP| image:: https://pyup.io/repos/github/tensorlayer/tensorlayer/shield.svg
  162. :target: https://pyup.io/repos/github/tensorlayer/tensorlayer/
  163. .. |Docker-Pulls| image:: http://ec2-35-178-47-120.eu-west-2.compute.amazonaws.com/docker/pulls/tensorlayer/tensorlayer.svg
  164. :target: https://hub.docker.com/r/tensorlayer/tensorlayer/
  165. .. |Code-Quality| image:: https://api.codacy.com/project/badge/Grade/d6b118784e25435498e7310745adb848
  166. :target: https://www.codacy.com/app/tensorlayer/tensorlayer

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