• 文件 >
  • 在 Linux 的 Windows 子系統 (WSL) 上使用 TorchServe
捷徑

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

  • 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. Clone 並安裝 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 的全面開發者文件

檢視文件

教學

取得初學者和進階開發者的深入教學

檢視教學

資源

尋找開發資源並獲得問題解答

檢視資源