Skip to content

Extra lib directory when adding dependencies for PyTorchModel #1832

Closed

Description

@setu4993

SDK Version: 2.3.0
PyTorch Framework version: 1.5
Python version: 3

When trying to deploy create a PyTorchModel object with dependencies, there's an extra intermediate lib directory being created.

Expected:

>>> opt/ml/code
>>>     |------ train.py
>>>     |------ common
>>>     |------ virtual-env

What's happening:

>>> opt/ml/code
>>>     |------ train.py
>>>     |------lib/
>>>                |------ common
>>>                |------ virtual-env

I found this line that causes this. Based on this, I think it should only occur for multi-model servers, but in my case it is happening while trying to use a single model.

Activity

  1. setu4993 commented on Aug 17, 2020

    @setu4993
    Author

    @metrizable : I think this should be tagged as a bug since documentation points to the expected being what users should expect.

  2. self-assigned this
    on Feb 4, 2025
  3. added a commit that references this issue on Nov 20, 2025
  4. mollyheamazon commented on Feb 2, 2026

    @mollyheamazon
    Contributor

    Hi @setu4993

    Great news! This issue has been resolved with the release of SageMaker Python SDK v3.

    How to Get the Latest Version

    You can upgrade to the latest v3 package using pip:

    pip install --upgrade sagemaker
    
    ##Or specify the version explicitly:
    pip install sagemaker>=3.0.0

    Additional Resources:

     PyPI: https://pypi.org/project/sagemaker/
     Documentation: https://sagemaker.readthedocs.io/

    If you're still experiencing this issue after upgrading, please feel free to reopen this issue or create a new one with updated details.

  5. added a commit that references this issue on Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions