TensorLayer 是一个新颖的基于 TensorFlow 的深度学习和强化学习库,专为研究人员和工程师设计。它提供了大量可定制的神经层,可以快速构建高级AI模型,在此基础上,社区开源海量教程和应用程序。 TensorLayer 荣获 ACM 多媒体协会颁发的 2017 年度最佳开源软件奖。该项目也可以在 OpenI 和 Gitee 上找到。
TensorLayer 是一个新的深度学习库,其设计考虑了简单性、灵活性和高性能。
TensorLayer 在 TensorFlow 包装器中处于独特的位置。 Keras 和 TFLearn 等其他包装器隐藏了 TensorFlow 的许多强大功能,并且对编写自定义 AI 模型几乎不提供支持。受 PyTorch 的启发,TensorLayer API 简单、灵活且 Pythonic,使其易于学习,同时足够灵活以应对复杂的 AI 任务。 TensorLayer 拥有一个快速发展的社区。它已被世界各地的研究人员和工程师使用,包括来自北京大学、伦敦帝国理工学院、加州大学伯克利分校、卡内基梅隆大学、斯坦福大学以及谷歌、微软、阿里巴巴、腾讯、小米和彭博等公司的研究人员和工程师。
TensorLayer 为初学者和专业人士提供了大量文档。该文档有英文和中文版本。
如果你想在 master 分支上尝试实验性功能,你可以在这里找到最新的文档。
您可以在此处和以下空间找到大量使用 TensorLayer 的示例:
TensorLayer 2.0 依赖于 TensorFlow、numpy 等。要使用 GPU,需要 CUDA 和 cuDNN。
安装 TensorFlow:
pip3 install tensorflow-gpu==2.0.0-rc1 # TensorFlow GPU (version 2.0 RC1)
pip3 install tensorflow # CPU version
安装 TensorLayer 的稳定版本:
pip3 install tensorlayer
安装 TensorLayer 的不稳定开发版本:
pip3 install git+https://github.com/tensorlayer/tensorlayer.git
如果你想安装额外的依赖项,你也可以运行
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
如果您是 TensorFlow 1.X 用户,可以使用 TensorLayer 1.11.0:
# For last stable version of TensorLayer 1.X
pip3 install --upgrade tensorlayer==1.11.0
下表显示了在 TITAN Xp 上使用 TensorLayer 和原生 TensorFlow 的 VGG16 的训练速度。
模式 | 库 | 数据格式 | 最大 GPU 内存使用量(MB) | 最大CPU内存使用量(MB) | 平均 CPU 内存使用量(MB) | 运行时间(秒) |
---|---|---|---|---|---|---|
签名 | TensorFlow 2.0 | 最后频道 | 11833 | 2161 | 2136 | 74 |
张量层2.0 | 最后频道 | 11833 | 2187 | 2169 | 76 | |
图形 | 喀拉斯 | 最后频道 | 8677 | 2580 | 2576 | 101 |
渴望的 | TensorFlow 2.0 | 最后频道 | 8723 | 2052 | 2024年 | 97 |
张量层2.0 | 最后频道 | 8723 | 2010年 | 2007年 | 95 |
请在提交 PR 之前阅读贡献者指南。
我们建议用户使用 Github issues 报告错误。用户也可以在下面的slack频道中讨论如何使用TensorLayer。
如果您发现 TensorLayer 对您的项目有用,请引用以下论文:
@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}
}
@inproceedings{tensorlayer2021,
title={Tensorlayer 3.0: A Deep Learning Library Compatible With Multiple Backends},
author={Lai, Cheng and Han, Jiarong and Dong, Hao},
booktitle={2021 IEEE International Conference on Multimedia & Expo Workshops (ICMEW)},
pages={1--3},
year={2021},
organization={IEEE}
}