【问题标题】:Why jupyter notebook packages are not working in aws sagemaker notebook instances?为什么 jupyter notebook 包在 aws sagemaker notebook 实例中不起作用?
【发布时间】:2020-05-29 01:27:41
【问题描述】:
fig, axes = plt.subplots(2,figsize=(15,10))
sns.lineplot(agg_cases_death.index, agg_cases_death.cases, ax=axes[0]).set_title('Cases')
sns.lineplot(agg_cases_death.index, agg_cases_death.deaths, ax=axes[1]).set_title('Deaths')
plt.show()

上面曾经在我桌面上的 jupyter notebook 上完美运行,但是当我在 AWS Sagemaker Jupyter notebook 中运行相同的代码时,它会产生错误。它说模块“seaborn”没有属性线图。

在使用 aws sagemaker jupyter 时我们需要设置什么?

【问题讨论】:

  • 如果笔记本在您的本地计算机上运行,​​您可能首先检查您安装的软件包版本,并确保在远程主机上安装了相同的版本。 $ pip show seaborn 会打印一些包的详细信息,包括你安装的版本。

标签: python amazon-web-services jupyter-notebook amazon-sagemaker


【解决方案1】:

众所周知,AWS Sagemaker 对此一窍不通。

试试sns.__version__,你会发现你运行的是旧的seaborn版本。

您可以通过以下方式解决此问题:

del sns

!conda update seaborn --yes

import seaborn as sns
sns.__version__

在单独的单元格中。

Seaborn 是 sagemaker 实例上默认 conda 设置的一部分,因此您不能使用 pip install 来修复版本问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-12-28
    • 1970-01-01
    • 2017-06-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多