Deploying directly from model artifacts

Viewed 227

I want to deploy a pretrained neural network as an endpoint at Sagemaker. All my model artifacts are stored in S3.

In the Sagemacer documentation (here) I found this solution:

from sagemaker.tensorflow import TensorFlowModel 

model = TensorFlowModel(model_data='s3://mybucket/model.tar.gz', role='MySageMakerRole')

predictor = model.deploy(initial_instance_count=1, instance_type='ml.c5.xlarge')

I adapted the TensorFlowModel() function like this:

from sagemaker.tensorflow import TensorFlowModel
from sagemaker import get_execution_role

role = get_execution_role()

tensorflow_model = TensorFlowModel(model_data='s3://my-bucket-name/path_to_the_model/model.tar.gz',
                                   role=role,
                                   framework_version='2.1.0')

This resulted in the error: TypeError: init() missing 1 required positional argument: 'entry_point'

The documentation of sagemaker.tensorflow.model.TensorFlowModel() (here) says about the argument entry point:

entry_point (str) – Path (absolute or relative) to the Python source file which should be executed as the entry point to model hosting. If source_dir is specified, then entry_point must point to a file located at the root of source_dir.

Is the documentation wrong or am I missing a major difference between my code and the example from the documentation?

0 Answers
Related