Open Janelle-He opened 3 years ago
Having the same issue here, did you manage to solve it?
Having the same issue here, did you manage to solve it?
Nope, I haven't solve it....
Hi guys! I´m having the same problem.
Hi! I come back with the solution, after playing and reading a lot. I decided to try another image_uri and it works. So In training I used the following aws sagemaker image: 763104351884.dkr.ecr.us-east-1.amazonaws.com/tensorflow-training:2.2.0-gpu-py37-cu102-ubuntu18.04
It works and I saved the model artifacts, then I loaded it:
from sagemaker.tensorflow import TensorFlowModel
model = TensorFlowModel(model_data='s3://...../output/model.tar.gz',
role=role,
image_uri = '763104351884.dkr.ecr.us-east-1.amazonaws.com/tensorflow-inference:2.2.0-gpu-py37-cu102-ubuntu18.04' )
As you can see I changed the image_uri from training to inference. After that I was able to create the endpoing. I hopo this help you in your projects!
@Janelle-He Hi, I met same error (TODAY!!!) and fix like that. At my case, I make wrong way to .tar.gz file.
import tarfile
# before(error!)
with tarfile.open(f"api_version/{api_version}_{postfix}.tar.gz", "w") as f:
# after(fix)
with tarfile.open(f"api_version/{api_version}_{postfix}.tar.gz", "w:gz", format=tarfile.GNU_FORMAT) as f:
I tried to build my own tensorflow algorithm in
train.py
by adopting frommnist-2.py
(available in amazon-sagemaker-examples/sagemaker-python-sdk/tensorflow_script_mode_training_and_serving/) and pass it as entry_point using the pre-built deep learning image. The training job completed with warning and there is an error in deploying the model.Below is the main function in
train.py
:The
estimator
created in the notebook instance is as follows:Here are the problems I encountered:
Warnining: no model artifact is saved under path /opt/ml/model. However, I did find a
model.tar.gz
in the output folder of this training job in S3.When deploying the estimator after
.fit
, by runningSo I also checked the CloudWatch logs for this endpoint and they all show the same event of
Can anyone help me with these problems? Many thanks in advance!