serve
serve copied to clipboard
Following instructions, model server does not start
» torchserve --start --model-store model_store --models densenet161=densenet161.mar
» Error: Could not find or load main class org.pytorch.serve.ModelServer
Install prereqs are met:
» python --version
Python 3.6.9 :: Anaconda, Inc.
» java -version
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
Also, java is in my PATH.
After a little investigation, I find that the entry point script is trying to call:
java -Dmodel_server_home=/Users/bradheintz/anaconda2/envs/torchserve/lib/python3.6/site-packages/torchserve-0.1.0b20191216-py3.6.egg -cp .:/Users/bradheintz/anaconda2/envs/torchserve/lib/python3.6/site-packages/torchserve-0.1.0b20191216-py3.6.egg/ts/frontend/* org.pytorch.serve.ModelServer --python /Users/bradheintz/anaconda2/envs/torchserve/bin/python -f config.properties -s model_store -m densenet161=densenet161.mar
Note the classpath. This is a problem, because:
» ls /Users/bradheintz/anaconda2/envs/torchserve/lib/python3.6/site-packages/torchserve-0.1.0b20191216-py3.6.egg/ts/frontend/
ls: /Users/bradheintz/anaconda2/envs/torchserve/lib/python3.6/site-packages/torchserve-0.1.0b20191216-py3.6.egg/ts/frontend/: No such file or directory
Which means the Java entry point is not being installed.
Doing another round of python setup.py build and python setup.py install seems to have done the trick. Keeping this open because this experience was problematic, and I have not seen installation work on the first try.
Just went through a clean install, and the instructions for starting the server work as advertised.