TorchServe 在 Windows Subsystem for Linux (WSL) 上¶
Ubuntu 18.0.4
本文档内容¶
在 WSL 上设置 Ubuntu 18.0.4:¶
从二进制文件安装¶
设置 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
安装 JDK 17
sudo apt-get install openjdk-17-jdk
安装依赖项
pip install torch torchtext torchvision sentencepiece psutil
pip install torchserve torch-model-archiver
从源代码安装¶
克隆并安装 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