SageMaker: Deploying keras "model.h5" into sagemaker inference

0

Hello everyone! I have this problem, where I'm trying to deploy an emotion recognition model (format: model.h5) # keras model But I have tried a couple of ways but it isn't working out for me. I tried saving the model using tf.saved_model.save which resulted in this structure: saved_model/ ├── assets/ ├── variables/ │ ├── variables.data-00000-of-00001 │ └── variables.index └── saved_model.pb

Then I packaged it to : model.tar.gz/ ├── 1/ │ ├── assets/ │ ├── variables/ │ ├── variables.data-00000-of-00001 │ └── variables.index │ └── saved_model.pb

But it didn't work, this is the code:

model = TensorFlowModel(model_data='s3://BUCKET/my-model-1.tar.gz', 
                        role=role, 
                        framework_version='2.4')

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

I got this error:
UnexpectedStatusException: Error hosting endpoint tensorflow-inference-2023-09-21.....: Failed. Reason: The primary container for production variant AllTraffic did not pass the ping health check. Please check CloudWatch logs for this endpoint..

Checking cloudwatch logs i see this:
Traceback (most recent call last): File "/sagemaker/serve.py", line 444, in <module> ServiceManager().start() File "/sagemaker/serve.py", line 424, in start self._create_tfs_config() File "/sagemaker/serve.py", line 128, in _create_tfs_config raise ValueError("no SavedModel bundles found!")

Would appreciate any help!
Thanks
답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인