Issue Summary: Failed endpoint deployment from the model registry.
CloudWatch Error Logs: AttributeError: 'NoneType' object has no attribute 'startswith'
Background: I have successfully trained & deployed an SKLearn model from a Notebooks script using the sagemaker.sklearn module. When creating the estimator, I pass a .py script with the entry point argument:
sklearn_estimator = SKLearn(entry_point='sklearn-train.py',
instance_type='ml.m5.large',
framework_version='0.23-1',
role=role,
sagemaker_session=sagemaker_session)
The sklearn-train.py script contains a function for loading a joblib file from the model directory. Using the estimator.deploy() method in the sagemaker.SKLearn library will fail without this function.
Based on my research, the AttributeError I'm getting when I deploy from the registry is related to a missing entry_point (the one I used to create the SKLearn estimator). The container is looking for a function that will load the tar file as a joblib object from the specified model_uri. After carefully reviewing the create_model() & create_endpoint_config() functions from the SM client library, I don't see any way to specify an entry_point script when saving or deploying a model to/from the registry.
Full stack trace:
Traceback (most recent call last):
File "/miniconda3/lib/python3.7/site-packages/gunicorn/workers/base_async.py", line 55, in handle
self.handle_request(listener_name, req, client, addr)
File "/miniconda3/lib/python3.7/site-packages/gunicorn/workers/ggevent.py", line 143, in handle_request
super().handle_request(listener_name, req, sock, addr)
File "/miniconda3/lib/python3.7/site-packages/gunicorn/workers/base_async.py", line 106, in handle_request
respiter = self.wsgi(environ, resp.start_response)
File "/miniconda3/lib/python3.7/site-packages/sagemaker_sklearn_container/serving.py", line 128, in main
serving_env.module_dir)
File "/miniconda3/lib/python3.7/site-packages/sagemaker_sklearn_container/serving.py", line 105, in import_module
user_module = importlib.import_module(module_name)
File "/miniconda3/lib/python3.7/importlib/init.py", line 118, in import_module
if name.startswith('.'):