-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
System Information
Python Version: 3.6
sagemaker-python-sdk Version: master (1.42.1.dev0)
sagemaker-mxnet-serving-container: 1.1.4.dev0) (using sagemkaer-infernece 1.0.1)
Are you using a custom image: no
Describe the problem
I am trying to deploy a model with a script depending on a library. The dependency to the library is configured with the dependenciesparameter of the MXNetmodel.
The model is successfully created, but When the model is started, the lib is not found by the code. It seems that that the sagemaker-mxnet-serving-container does not include in sys.path the /opt/ml/code/lib directory.
I am not sure if the integration bug must be solved into that repository or the sagemaker-mxnet-serving-container. As far as I understand, there is a fundamental changes in that repository which breaks the integration between both.
My source directory is:
- src
---- mypackage
--------__init__.py
--------myscript.py
--------utils.py
I create the model as:
MXNetModel( entry_point='../src/mypackage/myscript.py',
dependencies= ['../src/mypackage']
...
py_version='py3')
The output.tar.gz is the following:
- model/
---- my model.params
---- ...
---- code /
----------myscript.py (the script is copied at root)
----------lib/
--------------mypackage (the dependent lib is copied into the lib/ directory)
-------------------__init__.py
-------------------myscript.py
-------------------utils.py
The code in question is
sagemaker-python-sdk/src/sagemaker/utils.py
Line 471 in d38ed76
| lib_dir = os.path.join(code_dir, "lib") |
Nota: I have found a solution adding the following into the myscript.py:
sys.path.append('/opt/ml/model/code/lib')
But I guess this should not be the place to do it.