Sagemaker PySpark:内核已死

Sagemaker PySpark: Kernel Dead

我按照说明 here 设置了 EMR 集群和 SageMaker 笔记本。直到最后一步我才没有任何错误。

当我在 Sagemaker 中打开一个新笔记本时,我收到消息:

The kernel appears to have died. It will restart automatically.

然后:

        The kernel has died, and the automatic restart has failed.
        It is possible the kernel cannot be restarted. 
        If you are not able to restart the kernel, you will still be able to save the 
notebook, but running code will no longer work until the notebook is reopened.

这仅在我使用 pyspark/Sparkmagic 内核时发生。使用 Conda 内核或任何其他内核打开的笔记本都可以正常工作。

我的 EMR 集群完全按照说明设置,并添加了一条规则:

[
  {
    "Classification": "spark",
    "Properties": {
      "maximizeResourceAllocation": "true"
    }
  }
]

我很感激任何关于为什么会发生这种情况以及我如何做到的指示 debug/fix。

P.S.: 我过去成功地做到了这一点,没有任何问题。当我今天尝试重新做这个时,我 运行 陷入了这个问题。我尝试重新创建 EMR 集群和 Sagemaker 笔记本,但这没有帮助。

感谢您使用 Amazon SageMaker。

这里的问题是 Pandas 0.23.0 更改了名为 DataError 的核心 class 的位置,而 SparkMagic 尚未更新为需要来自正确命名空间的 DataError。

此问题的解决方法是使用 pip install pandas==0.22.0 降级 SageMaker Notebook 实例中的 Pandas 版本。

您可以在这个开放的 github 问题 https://github.com/jupyter-incubator/sparkmagic/issues/458 中获得更多信息。

如果有任何其他方式可以提供帮助,请告诉我们。

谢谢,
尼拉姆