Pytorch 1.1.0
Pytorch 1.1.0於2019-05-01發佈,詳情見https://github.com/pytorch/pytorch/releases/tag/v1.1.0
注: 不再支持CUDA8.0
概述:官方TensorBoard支持,屬性,字典,列表和JIT / TorchScript中用戶自定義的類型,改進了分佈式
Highlights:
- TensorBoard (試驗階段)
使用TensorBoard(一個用於檢查和理解訓練運行、張量和圖的web應用程序組件)對可視化和模型調試提供了一流的本機支持。PyTorch現在可通過一個簡單的命令from torch.utils.tensorboard import SummaryWriter
支持TensorBoard日誌記錄。直方圖、嵌入、標量、圖像、文本、圖形,以及更多可以在訓練過程中可視化。目前,TensorBoard支持還處於試驗階段。
- [JIT] Attributes in ScriptModules
- [JIT] TorchScript中支持字典和列表
- [JIT] TorchScript中的用戶定義類(試驗階段) 可以用@torch.jit.script註釋
- DistributedDataParallel新功能和教程:nn.parallel.distributeddataparparallel現在可以封裝多gpu模塊,它支持在一臺服務器上使用模型並行(教程)和跨服務器進行數據並行(教程)等用例。
重大更新:
Tensor.set_
: Tensor的設備不能再通過Tensor.set_
.來改變。這通常發生在使用默認CUDA設備設置張量,然後在另一個CUDA設備上交換存儲時。相反,從一開始就在正確的裝置上建立Tensor (18832).- 注意順序更改
lr_scheduler.step()
. (7889). torch.unique
: 更改sorted默認值爲
True
. (15379).- [JIT] 重命名 isTensor api -> isCompleteTensor. #18437
- [JIT] 移除GraphExecutor的python綁定. #19141
- [C++]:
Type
上的許多方法已不復存在;使用等價的函數法或張量法。 (17991). - [C++]:
TensorOptions的
後端構造函數不再存在. (18137). - [C++, Distributed]: 已刪除 c10d
ProcessGroup::getGroupRank
(19147).
Pytorch1.0.1
Pytorch1.0.1於2019-2-7發佈,詳情見https://github.com/pytorch/pytorch/releases/tag/v1.0.1,
- 修復了很多bug
- JIT
- Add better support for bools in the graph fuser (#15057)
- Allow tracing with fork/wait (#15184)
- improve script/no script save error (#15321)
- Add self to Python printer reserved words (#15318)
- Better error when torch.load-ing a JIT model (#15578)
- fix select after chunk op (#15672)
- Add script standard library documentation + cleanup (#14912)
- 性能優化
- LibTorch binaries now ship with CuDNN enabled. Without this change, many folks saw significant perf differences while using LibTorch vs PyTorch, this should be fixed now. #14976
- Make btriunpack work for high dimensional batches and faster than before (#15286)
- improve performance of unique with inverse indices (#16145)
- Re-enable OpenMP in binaries (got disabled because of a CMake refactor)
Pytorch 1.0
Pytorch 1.0於2018-12-8發佈,詳見https://github.com/pytorch/pytorch/releases/tag/v1.0.0
- 主要更新
- JIT
- 全新的分佈式訓練包:
torch.distributed
- 舊的接口放到了
torch.distributed.deprecated
中
- 舊的接口放到了
- C++ 接口 API [尚不穩定]
- Torch HUB:各種預訓練模型集合
- 重點更新
- 衆多新特性
- 增加了對 N 維空的 tensor 的支持
- 衆多新的 tensor 操作
- 新的分佈函數
- 對稀疏數據處理的 API 的改進
- 衆多新特性
- 修復了衆多bug,比如 torch.nn.functional.softmin 在 0.4.1 裏的公式是錯的,torch.nn.MSELoss 有時候計算錯誤等等
- 衆多改進
- 廢棄的方法
- 不再支持 C 接口
- 不再支持 torch.utils.trainer
- 性能優化
升級
本文中pytorch由0.4.0升級到1.0.1,再升級至1.1.0(也可以直接升級至1.1.0)
1. 首先用如下命令查看升級前的pytorch版本,返回版本號是0.4.0
python -c "import torch; print(torch.__version__)"
2. 輸入如下命令 conda install pytorch torchvision -c pytorch進行升級
conda install pytorch torchvision -c pytorch
3. 升級後再用1中的命令查看一下升級後的pytorch版本,返回是1.0.1表示升級成功。
4. 重複1-3的步驟可以將pytorch1.0.1再次升級至1.1.0
Note:
在Windows+Python 3.7+CUDA10環境下安裝PyTorch 1.2.0的命令如下:
pip install torch==1.2.0 -f https://download.pytorch.org/whl/cu100/torch-1.2.0-cp37-cp37m-win_amd64.whl
Python3.6, CUDA92環境下安裝PyTorch1.3的命令爲:
pip install torch==1.3.1 -f https://download.pytorch.org/whl/torch_stable.html
參考資料:
1. https://www.pytorchtutorial.com/pytorch-1-0/
2. https://github.com/pytorch/pytorch