# tensorlayer **Repository Path**: tigeryuran/tensorlayer ## Basic Information - **Project Name**: tensorlayer - **Description**: TensorLayer是一个基于TensorFlow的新型深度学习和强化学习库(TensorLayer开源中国官方镜像) - **Primary Language**: Python - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: http://github.com/tensorlayer/tensorlayer - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 16 - **Created**: 2019-08-30 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README
![GitHub last commit (branch)](https://img.shields.io/github/last-commit/tensorlayer/tensorlayer/master.svg) [![Supported TF Version](https://img.shields.io/badge/TensorFlow-2.0.0%2B-brightgreen.svg)](https://github.com/tensorflow/tensorflow/releases) [![Documentation Status](https://readthedocs.org/projects/tensorlayer/badge/)](https://tensorlayer.readthedocs.io/) [![Build Status](https://travis-ci.org/tensorlayer/tensorlayer.svg?branch=master)](https://travis-ci.org/tensorlayer/tensorlayer) [![Downloads](http://pepy.tech/badge/tensorlayer)](http://pepy.tech/project/tensorlayer) [![Docker Pulls](https://img.shields.io/docker/pulls/tensorlayer/tensorlayer.svg)](https://hub.docker.com/r/tensorlayer/tensorlayer/) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/d6b118784e25435498e7310745adb848)](https://www.codacy.com/app/tensorlayer/tensorlayer)

TensorLayer is a novel TensorFlow-based deep learning and reinforcement learning library designed for researchers and engineers. It provides a large collection of customizable neural layers / functions that are key to build real-world AI applications. TensorLayer is awarded the 2017 Best Open Source Software by the [ACM Multimedia Society](https://twitter.com/ImperialDSI/status/923928895325442049). 🔥📰🔥 Reinforcement Learning Model Zoos: [Low-level APIs for Research](https://github.com/tensorlayer/tensorlayer/tree/master/examples/reinforcement_learning) and [High-level APIs for Production](https://github.com/tensorlayer/RLzoo) 🔥📰🔥 [Sipeed Maxi-EMC](https://github.com/sipeed/Maix-EMC): Run TensorLayer models on the **low-cost AI chip** (e.g., K210) (Alpha Version) 🔥📰🔥 [NNoM](https://github.com/majianjia/nnom): Run TensorLayer quantized models on the **MCU** (e.g., STM32) (Coming Soon) # Features As deep learning practitioners, we have been looking for a library that can address various development purposes. This library is easy to adopt by providing diverse examples, tutorials and pre-trained models. Also, it allow users to easily fine-tune TensorFlow; while being suitable for production deployment. TensorLayer aims to satisfy all these purposes. It has three key features: - ***Simplicity*** : TensorLayer lifts the low-level dataflow interface of TensorFlow to *high-level* layers / models. It is very easy to learn through the rich [example codes](https://github.com/tensorlayer/awesome-tensorlayer) contributed by a wide community. - ***Flexibility*** : TensorLayer APIs are transparent: it does not mask TensorFlow from users; but leaving massive hooks that help *low-level tuning* and *deep customization*. - ***Zero-cost Abstraction*** : TensorLayer can achieve the *full power* of TensorFlow. 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. | Mode | Lib | Data Format | Max GPU Memory Usage(MB) |Max CPU Memory Usage(MB) | Avg CPU Memory Usage(MB) | Runtime (sec) | | :-------: | :-------------: | :-----------: | :-----------------: | :-----------------: | :-----------------: | :-----------: | | AutoGraph | TensorFlow 2.0 | channel last | 11833 | 2161 | 2136 | 74 | | | Tensorlayer 2.0 | channel last | 11833 | 2187 | 2169 | 76 | | Graph | Keras | channel last | 8677 | 2580 | 2576 | 101 | | Eager | TensorFlow 2.0 | channel last | 8723 | 2052 | 2024 | 97 | | | TensorLayer 2.0 | channel last | 8723 | 2010 | 2007 | 95 | TensorLayer stands at a unique spot in the library landscape. Other wrapper libraries like Keras and TFLearn also provide high-level abstractions. They, however, often hide the underlying engine from users, which make them hard to customize and fine-tune. On the contrary, TensorLayer APIs are generally lightweight, flexible and transparent. Users often find it easy to start with the examples and tutorials, and then dive into TensorFlow seamlessly. In addition, TensorLayer does not create library lock-in through native supports for importing components from Keras. TensorLayer has a fast growing usage among top researchers and engineers, from universities like Peking University, Imperial College London, UC Berkeley, Carnegie Mellon University, Stanford University, and University of Technology of Compiegne (UTC), and companies like Google, Microsoft, Alibaba, Tencent, Xiaomi, and Bloomberg. # Tutorials and Real-World Applications You can find a large collection of tutorials, examples and real-world applications using TensorLayer within [examples](examples/) or through the following space:
# Documentation TensorLayer has extensive documentation for both beginners and professionals. The documentation is available in both English and Chinese. Please click the following icons to find the documents you need: [![English Documentation](https://img.shields.io/badge/documentation-english-blue.svg)](https://tensorlayer.readthedocs.io/) [![Chinese Documentation](https://img.shields.io/badge/documentation-%E4%B8%AD%E6%96%87-blue.svg)](https://tensorlayercn.readthedocs.io/) [![Chinese Book](https://img.shields.io/badge/book-%E4%B8%AD%E6%96%87-blue.svg)](http://www.broadview.com.cn/book/5059/) If you want to try the experimental features on the the master branch, you can find the latest document [here](https://tensorlayer.readthedocs.io/en/latest/). # Install For latest code for TensorLayer 2.0, please build from the source. TensorLayer 2.0 has pre-requisites including TensorFlow 2, numpy, and others. For GPU support, CUDA and cuDNN are required. Install TensorFlow: ```bash pip3 install tensorflow-gpu==2.0.0-beta1 # specific version (YOU SHOULD INSTALL THIS ONE NOW) pip3 install tensorflow-gpu # GPU version pip3 install tensorflow # CPU version ``` Install the stable version of TensorLayer: ```bash pip3 install tensorlayer ``` Install the latest version of TensorLayer: ```bash pip3 install git+https://github.com/tensorlayer/tensorlayer.git or pip3 install https://github.com/tensorlayer/tensorlayer/archive/master.zip ``` For developers, you should clone the folder to your local machine and put it along with your project scripts. ```bash git clone https://github.com/tensorlayer/tensorlayer.git ``` If you want install TensorLayer 1.X, the simplest way to install TensorLayer 1.X is to use the **Py**thon **P**ackage **I**ndex (PyPI): ```bash # for last stable version of TensorLayer 1.X pip3 install --upgrade tensorlayer==1.X # for latest release candidate of TensorLayer 1.X pip3 install --upgrade --pre tensorlayer # if you want to install the additional dependencies, you can also run pip3 install --upgrade tensorlayer[all] # all additional dependencies pip3 install --upgrade tensorlayer[extra] # only the `extra` dependencies pip3 install --upgrade tensorlayer[contrib_loggers] # only the `contrib_loggers` dependencies ``` # Contribute Please read the [Contributor Guideline](CONTRIBUTING.md) before submitting your PRs. # Cite If you use TensorLayer for any projects, please cite this paper: ``` @article{tensorlayer2017, author = {Dong, Hao and Supratak, Akara and Mai, Luo and Liu, Fangde and Oehmichen, Axel and Yu, Simiao and Guo, Yike}, journal = {ACM Multimedia}, title = {{TensorLayer: A Versatile Library for Efficient Deep Learning Development}}, url = {http://tensorlayer.org}, year = {2017} } ``` # License TensorLayer is released under the Apache 2.0 license. We also host TensorLayer on [iHub](https://code.ihub.org.cn/projects/328) and [Gitee](https://gitee.com/organizations/TensorLayer).