serve icon indicating copy to clipboard operation
serve copied to clipboard

Steps for running model archive from docker

Open chauhang opened this issue 6 years ago • 4 comments

Add the steps for how to do the model archive when using torchserve docker containers

chauhang avatar Apr 13 '20 15:04 chauhang

Please add me to the review when these steps are created.

aaronmarkham avatar May 01 '20 16:05 aaronmarkham

@chauhang Assuming this is only for the local containers as remote containers should pull mar files from S3/other public URL. For local container, user can use either a. docker cp <marFile> <container_name>:<target_dir> OR b. Share mar files by mapping local dir. with model-store dir. in container e.g. docker run --rm -p 8080:8080 -p 8081:8081 -v /Users/user1/model-store:/home/model-server/model-store -t torchserve_image:1.0 torchserve --start --model-store /home/model-server/model-store

Once confirmed, will go ahead and update docker doc with additional steps for this.

codinnvrends avatar May 05 '20 13:05 codinnvrends

@dhaniram-kshirsagar This is for creation of the .mar file. If someone is using docker for running everything they need steps for how to invoke this for a docker setup.

There can be two options:

Option A

Easy option is to run the docker in interactive mode with a volume mount of folder that has the model source files and the model store (destination) and then inside the docker manually run the torch-model-archiver command to generate the mar file eg

docker run --rm -p 8080:8080 -p 8081:8081 -v $(pwd)/model-store:/model-store  -v $(pwd)/examples:/examples torchserve:latest bash

model-server@98b1c682955c:~$ torch-model-archiver ...

Option B

Provide steps to launch torch-model-archiver from the docker run eg

docker run --rm -p 8080:8080 -p 8081:8081 -v $(pwd)/model-store:/model-store  -v $(pwd)/examples:/examples torchserve:latest torch-model-archiver --model-name densenet161 --version 1.0 --model-file /examples/image_classifier/densenet_161/model.py --serialized-file /examples/image_classifier/densenet161-8d451a50.pth --export-path /model-store --extra-files /examples/image_classifier/index_to_name.json --handler image_classifier

chauhang avatar May 10 '20 07:05 chauhang

Added steps in #308 under docker/README.md#docker_torch_model_archiver

codinnvrends avatar May 18 '20 19:05 codinnvrends