Skip to content

Must provide absolute path in local mode, not in remote mode #2747

@neilmcguigan

Description

@neilmcguigan

Describe the bug
Create an SKLearn estimator. Call fit(). Works great. Repeat with local mode on. Fails

To reproduce

from sagemaker.local import LocalSession
from sagemaker.sklearn.estimator import SKLearn

sagemaker_session = LocalSession()
sagemaker_session.config = {'local': {'local_code': True}}

role = "arn:aws:iam::123456789012:role/Foo"

estimator = SKLearn(
    entry_point="foo.py",
    framework_version="0.23-1",
    role=role,
    instance_count=1,
    instance_type="local"
)

estimator.fit()

The above works without local mode.
The above fails in local mode with an obscure Docker compose error.
If you provide the absolute path to "foo.py" it works

Expected behavior
Should work with same code in local and remote mode

System information
A description of your system. Please provide:

  • SageMaker Python SDK version: latest
  • Framework name (eg. PyTorch) or algorithm (eg. KMeans): sklearn
  • Framework version: 0.23-1
  • Python version: 3.x
  • CPU or GPU: CPU
  • Custom Docker image (Y/N): N

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions