Skip to content

Installing dependencies within that container #1449

@Alaa-1

Description

@Alaa-1

I'm using some sound libraries in order to do preprocessing (in inference.py file) before sending the data to the model to make prediction. The problem is one of those libraries is SoundFile which throwing an error when I check CloudWatch "OSError: sndfile library not found" . After some research, I found out that I have to install a package called libsndfile using this command "apt install libsndfile" .

I'm wondering if there's a way to install that package using script mode or another method from within SageMaker besides having to make my own docker image ??

Additional information:
I'm deploying directly from model artifacts

sagemaker_model = Model(model_data = 's3://' + sagemaker_session.default_bucket() +'/model/model.tar.gz',
role = role,
framework_version = '2.1.0',
source_dir='my_src',
entry_point = ' inference.py',
env={'SAGEMAKER_REQUIREMENTS': 'requirements.txt'})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions