This project is no longer actively maintained. While existing releases remain available, there are no planned updates, bug fixes, new features, or security patches. Users should be aware that vulnerabilities may not be addressed.
- At present, it has only been certified on windows server 2019 however should work fine on Windows 10.
- Make sure you are an admin user or have admin rights
- The instruction given here will use anaconda Powershell terminal to install torchserve
- Install Anaconda as given here
- Install Git as given here
- Install openjdk17
- Download openjdk17
- Unzip and edit/add environment variables i.e. PATH and JAVA_HOME e.g.
- Using command line
unzip jdk-17.0.3_windows-x64_bin.zipor using GUI interface - Edit system or user profile environment variable
PATHvalue and append path<your-openjdk17-path>\binto it
- Install nodejs
- Download nodejs
- Post installation make sure nodejs and npm node modules binaries are present in PATH environment variable.
- You may have to re-start windows if your 'Anaconda Powershell Prompt' (APP) is not able to detect npm or nodejs commands
NOTE At present, wheels for windows are not available on PyPi. However following steps can also be used if you have prebuilt torchserve wheel for windows.
- Start 'Anaconda Powershell Prompt' (APP) as Admin User i.e. By right click on APP and run following commands
git clone https://github.com/pytorch/serve.gitcd servepython .\ts_scripts\install_dependencies.py- For local wheel file
pip install <your-torchserve-wheel-file-name>.whl
- For PyPi package (N/A at present)
pip install torchserve torch-model-archiver
- Start torchserve
torchserve.exe --start --model-store <path-to-model-store> - For next steps refer Serving a model
-
Ensure that system or user profile environment variable name
JAVA_HOMEwith value as<your-openjdk17-path>path is present. -
Install Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019
NOTE ensure that you have restarted system after install above Visual C++ components
-
Ensure that 'nvidia-smi.exe' is available in
Pathenvironment variable. Usually, it should be available under<your_install_drive>\Program Files\NVIDIA Corporation\NVSMIe.g. C:\Program Files\NVIDIA Corporation\NVSMI, add this path toPathenv variable -
Start 'Anaconda Powershell Prompt' (APP) as Admin User i.e. By right click on APP and run following commands
-
git clone https://github.com/pytorch/serve.git -
pip install click -
cd servepython .\ts_scripts\install_dependencies.py --environment=prodpython .\ts_scripts\install_from_src.py
If you plan to develop with TorchServe and change some source code, commands below will help. The install_dependencies script installs few extra dependencies which are needed for development and testing.
python .\ts_scripts\install_dependencies.py --environment=devpython .\ts_scripts\install_from_src.py
- If you are building from source then you may have to change the port number for inference, management and metrics apis as specified in
frontend/server/src/test/resources/config.properties, all files infrontend/server/src/test/resources/snapshot/*andfrontend/server/src/main/java/org/pytorch/serve/util/ConfigManager.java - If
curlcommand fails to execute then run following command on APP (anaconda powershell prompt)Remove-item alias:curlRefer to this SO answer for details.