Skip to content

Not able to deploy pretrained Pytorch Model #1726

@mukeshyadav

Description

@mukeshyadav

I have a pre-trained model, now trying to create an endpoint using Sagemaker, my folder structure like this
"model.tar.gz" looks like this:

model
|- config.json
|- pytorch_model.bin
|- special_tokens_map.json
|- spiece.model
|- tokenizer_config.json
|- training_args.bin
code
|- inference.py
| - requirements.txt

running following script to create endpoint:

pytorch_model = PyTorchModel( model_data='s3://mck-dl-ai-studio/answer_card/answercard.tar.gz', role=role, entry_point='inference.py', framework_version="1.3.1")

predictor = pytorch_model.deploy(instance_type='ml.t2.medium', initial_instance_count=1)

An error occurred (ModelError) when calling the InvokeEndpoint operation: Received server error (500) from model with message "No module named 'transformers'". See https://us-west-2.console.aws.amazon.com/cloudwatch/home?region=us-west-2#logEventViewer:group=/aws/sagemaker/Endpoints/pytorch-inference-2020-07-20-16-45-51-564 in account xxxxxx for more information.

what I am missing here tried adding source_dir and py_version but no success

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions