Custom Hyperparameters to SageMaker PyTorchModel Inference?

0

Hello,

Is it possible to pass hyperparameters to a PyTorchModel? For instance, in my training script, I would like to load data from the training bucket for use in inference. How would I provide the S3 URI to the inference script from the Estimator and how would it be accessed from within the inference script? Right now I am trying everything from within a SageMaker Notebook Instance. Thanks for any help!

In my notebook I have:

from sagemaker.pytorch.model import PyTorchModel
model_bucket = .......
pytorch_model = PyTorchModel(
    model_data= model_bucket, 
    role=role,                               
    entry_point='inference.py', 
    py_version="py39",
    framework_version="1.13",
)

My inference.py holds:

def model_fn(model_dir):
    pass
def input_fn(request_body, request_content_type):
    pass
def predict_fn(input_data, model):
    pass
def output_fn(prediction, content_type):
    pass
Samuel
질문됨 일 년 전44회 조회
답변 없음

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

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

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

관련 콘텐츠