Skip to content

Deep Learning and Reinforcement Learning Library for Scientists

License

Notifications You must be signed in to change notification settings

Officium/tensorlayer

 
 

Repository files navigation

GitHub last commit (branch) Supported TF Version Documentation Status Build Status Downloads Docker Pulls Codacy Badge



TensorLayer 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 complex AI models. TensorLayer is awarded the 2017 Best Open Source Software by the ACM Multimedia Society. TensorLayer can also be found at iHub and Gitee.

News

🔥📰🔥 Reinforcement Learning Model Zoos: Low-level APIs for Research and High-level APIs for Production

🔥📰🔥 Sipeed Maxi-EMC: Run TensorLayer models on the low-cost AI chip (e.g., K210) (Alpha Version)

🔥📰🔥 NNoM: Run TensorLayer quantized models on the MCU (e.g., STM32) (Coming Soon)

🔥📰🔥 Free GPU and Data Storage from SurgicalAI: SurgicalAI is sponsoring the TensorLayer Community with Cloud Computing Resources such as Free GPUs and Data Storage.

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 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 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 has extensive documentation for both beginners and professionals. The documentation is available in both English and Chinese.

English Documentation Chinese Documentation Chinese Book

If you want to try the experimental features on the the master branch, you can find the latest document here.

Extensive examples

You can find a large collection of tutorials, examples and real-world applications using TensorLayer within examples or through the following space:

Installing TensorLayer is easy

TensorLayer 2.0 relies on TensorFlow, numpy, and others. To use GPUs, CUDA and cuDNN are required.

Install TensorFlow:

pip3 install tensorflow-gpu==2.0.0-rc1 # TensorFlow GPU (version 2.0 RC1)
pip3 install tensorflow # CPU version

Install the stable release of TensorLayer:

pip3 install tensorlayer

Install the unstable development version of TensorLayer:

pip3 install git+https://github.com/tensorlayer/tensorlayer.git

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

Benchmark

The following table shows the training speeds of VGG16 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

Contribute

Please read the Contributor Guideline 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.

About

Deep Learning and Reinforcement Learning Library for Scientists

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.6%
  • Other 0.4%