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}
}