• 文件 >
  • TorchServe 在 Linux 的 Windows 子系統 (WSL) 上
快捷方式

⚠️ 注意:有限維護

此專案不再積極維護。現有版本仍然可用,但沒有計劃的更新、錯誤修復、新功能或安全補丁。使用者應注意,漏洞可能不會得到解決。

TorchServe 在 Linux 的 Windows 子系統 (WSL) 上

  • Ubuntu 18.0.4

本文件內容

在 WSL 上安裝 Ubuntu 18.0.4:

從二進位制檔案安裝

  1. 設定 Ubuntu 環境

wget -O - https://raw.githubusercontent.com/pytorch/serve/master/ts_scripts/setup_wsl_ubuntu | bash
echo 'export PATH=$HOME/.local/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
  1. 安裝 JDK 17

sudo apt-get install openjdk-17-jdk
  1. 安裝依賴項

pip install torch torchtext torchvision sentencepiece psutil
pip install torchserve torch-model-archiver

從原始碼安裝

  1. 克隆並安裝 TorchServe

git clone https://github.com/pytorch/serve.git
cd serve

./ts_scripts/setup_wsl_ubuntu
export PATH=$HOME/.local/bin:$PATH
python ./ts_scripts/install_from_src.py
echo 'export PATH=$HOME/.local/bin:$PATH' >> ~/.bashrc
source ~/.bashrc

文件

訪問 PyTorch 的全面開發者文件

檢視文件

教程

獲取面向初學者和高階開發者的深入教程

檢視教程

資源

查詢開發資源並獲得問題解答

檢視資源