スキップしてコンテンツを表示

on restarting the instance in sagemaker and selecting kernel, not able to import modules

0

Hello I created, activated, installed modules and saved a new environment as a kernel in sagemaker studio using below commands, !conda create -n myenv -y !source activate myenv !pip install kxyz !python -m ipykernel install --user --name myenv --display-name "Neyd"

then closed the instance and then restarted the instance and selected the Neyd kernel. But, then import kxyz shows no module found. pip list also doesnt show this module, !conda env list also doesnt show myenv .

can someone help. i dont want to install all packages everytime I start the instance.

質問済み 3年前1304ビュー

2回答
1

if you stop a notebook instance, you will lose any changes you made to the Conda environment or installed packages in that session. If you want to keep your changes, you can either create a persistent Conda environment or save your work to a persistent storage location.

Here are some additional details about the implications of stopping a notebook instance:

  • Any data that is stored in the notebook's ephemeral storage (such as the /tmp directory) will be lost.
  • Any running processes will be terminated.
  • Any changes you made to the notebook's configuration will be lost.

Solution:

AWS

回答済み 3年前

-1

When you stop a notebook, SageMaker terminates the notebook's Amazon Elastic Compute Cloud (Amazon EC2) instance. Non-persistent Conda environments and the packages installed don't persist between sessions. SageMaker domains and Studio use an EFS volume as a persistent storage layer. You can save your Conda environments on this EFS volume. These environments are persistent between kernel, app, or Studio restart. Studio automatically picks up all environments as KernelGateway kernels.

To Create persistent Conda environments on a Studio EFS volume, please refer the AWS article [1] and GitHub [2] which guides you through step-by-step process along with detailed instructions.

References :
[1] https://aws.amazon.com/blogs/machine-learning/four-approaches-to-manage-python-packages-in-amazon-sagemaker-studio-notebooks/#:~:text=Persist%20Conda%20environments%20to%20the%20Studio%20EFS%20volume
[2] https://github.com/durgasury/efs_backed_conda

AWS
サポートエンジニア

回答済み 3年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

関連するコンテンツ