aws / sagemaker-pytorch-inference-toolkit

Toolkit for allowing inference and serving with PyTorch on SageMaker. Dockerfiles used for building SageMaker Pytorch Containers are at https://github.com/aws/deep-learning-containers.
Apache License 2.0
134 stars 72 forks source link

MultiDataModel fails at installing requirements.txt #105

Open EliasWiegandt opened 3 years ago

EliasWiegandt commented 3 years ago

Describe the bug The packages in requirements.txt are not installed, when deploying a MultiDataModel with Sagemaker.

To reproduce Deploy a model to sagemaker that depends on requirements.txt installing specific packages, e.g. pandas.

My architecture looks like this:

model.tar.gz/
| - ....
| - code/
  | - inference.py
  | - requirements.txt

Expected behavior It is expected that the requirements are installed.

Additional context I first had the same issues as here, which is solved by the inference.py being be included in the model.tar.gz - but it also indicates that all files inside /opt/ml/model are removed when the image is being spun up. I suspect that requirements.txt is therefore also removed and first "recovered" again later, when the model.tar.gz is unpacked. This would explain why the requirements are never installed.