Skip to content

Commit 154f1d3

Browse files
authored
Merge branch 'master' into fix-spark-2.4-image-uri-config
2 parents 2ff01d2 + 7f9ab2b commit 154f1d3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/sagemaker/local/image.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,9 +469,12 @@ def _prepare_training_volumes(
469469

470470
volumes.append(_Volume(model_dir, "/opt/ml/model"))
471471

472-
# Mount the metadata directory on the notebook instance,
473-
# this is used by some DeepEngine libraries
474-
volumes.append(_Volume("/opt/ml/metadata", "/opt/ml/metadata"))
472+
# Mount the metadata directory if present.
473+
# Only expected to be present on SM notebook instances.
474+
# This is used by some DeepEngine libraries
475+
metadata_dir = "/opt/ml/metadata"
476+
if os.path.isdir(metadata_dir):
477+
volumes.append(_Volume(metadata_dir, metadata_dir))
475478

476479
# Set up the channels for the containers. For local data we will
477480
# mount the local directory to the container. For S3 Data we will download the S3 data

0 commit comments

Comments
 (0)