Skip to content

JingqingZ/tensorlayer2

 
 

Repository files navigation

GitHub last commit (branch) Supported TF Version Documentation Status



🚀🚀🚀🚀 Welcome to TensorLayer 2.0 !

We are working hard on updating TensorLayer 2.0 to support TensorFlow 2.0. Latest progress can be found here and latest doc. Feel free to discuss and contribute! Note that TensorLayer 2.0 is still under construction and not everything in this repository is ready yet.

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.

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 Tesla V100-DGXS-32GB.

    Mode Lib Data Format Max CPU Memory (MB) Avg CPU Memory (MB) Runtime (sec)
    AutoGraph TensorFlow 2.0 channel last 3370 3346 49
    Tensorlayer 2.0 channel last 3358 3367 50
    Graph Keras channel last 3776 3775 62
    Eager TensorFlow 2.0 channel last 3293 3284 65
    TensorLayer 2.0 channel last 3296 3293 65
    PyTorch channel first 2562 2555 43

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, TFSlim and TFLearn.

TensorLayer has a fast growing usage among top researchers and engineers, from universities like 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 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

Chinese Book

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

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.

# First clone the repository and change the current directory to the newly cloned repository
git clone https://github.com/zsdonghao/tensorlayer2.git
cd tensorlayer2

# Install virtualenv if necessary
pip install virtualenv
# Then create a virtualenv called `venv`
virtualenv venv

# Activate the virtualenv

## Linux:
source venv/bin/activate

## Windows:
venv\Scripts\activate.bat

# basic installation
pip install .

# ============= IF TENSORFLOW IS NOT ALREADY INSTALLED ============= #

# for a machine **without** an NVIDIA GPU
pip install -e ".[all_cpu_dev]"

# for a machine **with** an NVIDIA GPU
pip install -e ".[all_gpu_dev]"

If you want install TensorLayer 1.X, the simplest way to install TensorLayer 1.X is to use the Python Package Index (PyPI):

# for last stable version of TensorLayer 1.X
pip install --upgrade tensorlayer

# for latest release candidate of TensorLayer 1.X
pip install --upgrade --pre tensorlayer

# if you want to install the additional dependencies, you can also run
pip install --upgrade tensorlayer[all]              # all additional dependencies
pip install --upgrade tensorlayer[extra]            # only the `extra` dependencies
pip install --upgrade tensorlayer[contrib_loggers]  # only the `contrib_loggers` dependencies

Contribute

Please read the Contributor Guideline before submitting your PRs.

Cite

If you find this project useful, we would be grateful if you cite the TensorLayer 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

[WIP] Updating TensorLayer for TensorFlow 2.0

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.5%
  • Other 0.5%