简体   繁体   English

AWS Sagemaker:Jupyter Notebook kernel 不断死机

[英]AWS Sagemaker: Jupyter Notebook kernel keeps dying

I get disconnect every now and then when running a piece of code in Jupyter Notebooks on Sagemaker.在 Sagemaker 上的 Jupyter Notebooks 中运行一段代码时,我时不时会断开连接。 I usually just restart my notebook and run all the cells again.我通常只是重新启动我的笔记本并再次运行所有单元格。 However, I want to know if there is a way to reconnect to my instance without having to lose my progress.但是,我想知道是否有一种方法可以在不丢失进度的情况下重新连接到我的实例。 At the minute, it shows that there is "No Kernel" at the bottom bar, but my file seems active in the kernel sessions tab.目前,底部栏显示“无内核”,但我的文件在 kernel 会话选项卡中似乎处于活动状态。 Can I recover my notebook's variables and contents?我可以恢复笔记本的变量和内容吗? Also, is there a way to prevent future kernel disconnections?另外,有没有办法防止将来 kernel 断开连接?

Note that I reverted back to tornado = 5.1.1, which seems to decrease the number of disconnections, but it still happens every now and then.请注意,我恢复到 tornado = 5.1.1,这似乎减少了断开连接的次数,但它仍然时不时发生。

Often, disconnections will be caused by inactivity because a job is running for a long time with no user input.通常,断开连接是由不活动引起的,因为作业长时间运行而没有用户输入。 If it's pre-processing that's taking a long time, you could increase the instance size of the processing job so that it executes faster, or increase the instance count.如果需要很长时间的预处理,您可以增加处理作业的实例大小以使其执行得更快,或者增加实例数。 If you're using EMR, you can now run an EMR Spark query directly on the EMR cluster since December 2021: https://aws.amazon.com/about-aws/whats-new/2021/12/amazon-sagemaker-studio-data-notebook-integration-emr/如果您使用的是 EMR,自 2021 年 12 月起,您现在可以直接在 EMR 集群上运行 EMR Spark 查询: https://aws.amazon.com/about-aws/whats-new/2021/12/amazon-sagemaker-工作室数据笔记本集成 emr/

There's a useful blog here https://aws.amazon.com/blogs/machine-learning/build-amazon-sagemaker-notebooks-backed-by-spark-in-amazon-emr/ which is helpful in getting you up and running.这里有一个有用的博客https://aws.amazon.com/blogs/machine-learning/build-amazon-sagemaker-notebooks-backed-by-spark-in-amazon-emr/这有助于您启动和运行.

Please let me know if you need more information, or vote for the answer if it's useful.如果您需要更多信息,请告诉我,如果有用,请投票给答案。 :-) :-)

For me a quick solution was to open a Terminal instead, save the notebook file as a Pytohn file, and run it from the terminal within Sagemaker.对我来说,一个快速的解决方案是打开一个终端,将笔记本文件保存为 Pytohn 文件,然后从 Sagemaker 中的终端运行它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AWS sagemaker 上的多用户公共 jupyter 笔记本 - multiuser public jupyter notebook on AWS sagemaker 无法在 AWS Sagemaker 上打开 Jupyter Notebook 实例 - Unable to open Jupyter Notebook instance on AWS Sagemaker 为什么 jupyter notebook 包在 aws sagemaker notebook 实例中不起作用? - Why jupyter notebook packages are not working in aws sagemaker notebook instances? 使用 AWS Lambda 在 AWS Sagemaker 上执行 jupyter notebook - Use AWS Lambda to execute a jupyter notebook on AWS Sagemaker 如何在AWS SageMaker(Jupyter Notebook)中使用cx_Oracle - How to use cx_Oracle within AWS SageMaker (Jupyter Notebook) AWS Sagemaker 自定义小部件安装 Jupyter Notebook 或 Lab - AWS Sagemaker Custom Widget Installation Jupyter Notebook or Lab 如何在 AWS Sagemaker 笔记本实例中有条件地运行不同的 Jupyter 笔记本 - How to run different Jupyter notebooks conditionally in a AWS Sagemaker notebook instance 在没有 SageMaker 的情况下将 Jupyter Notebook(本地)连接到 AWS s3 - Connect Jupyter Notebook (locally) to AWS s3 without SageMaker 如何在 AWS Sagemaker notebook 中将 git 包导入 spark 内核 - How to import git package into spark kernel in AWS Sagemaker notebook AWS Sagemaker,如何将现有的本地 jupyter notebook 与 ML 算法连接到 AWS - AWS Sagemaker, how to connect existing local jupyter notebook with ML algorithms to AWS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM