无法让 LaTeX 在 Amazon SageMaker 中工作

问题描述 投票:0回答:1

我正在 SageMaker 中运行 python 笔记本,但是,笔记本需要 LaTeX 才能使用。我该如何在 SageMaker 笔记本实例上安装 LaTeX?有关更多信息,这是 python 产生的错误;

RuntimeError: Failed to process string with tex because latex could not be found

感谢您的帮助!

我尝试从官方 aws-samples 运行 on-start 脚本,该脚本应该启用 LaTeX(最初用于 pdf 导出,但应该用于此目的)。但是,在尝试启动笔记本内核时,我收到此错误(一些信息替换为

<->
;

Failed to start kernel due to start-up script failure

Failed to launch app [pytorch-1-1-ml-g4dn-xl-latex-on-st-<->]. ConfigurationError: LifecycleConfig execution failed with non zero exit code 127 for script arn:aws:sagemaker:<>:studio-lifecycle-config/latex-on-start. Check https://docs.aws.amazon.com/sagemaker/latest/dg/studio-lcc-debug.html for debugging instructions. (Context: RequestId: c7d9252d-09d9-4eff-845b-69c150898e10, TimeStamp: 1674399729.767251, Date: Sun Jan 22 15:02:09 2023)

No failed app was found
amazon-web-services amazon-sagemaker
1个回答
0
投票

我在通过 AWS Web 控制台配置 LCC 时遇到了同样的错误。

事实证明,当您在 Web 控制台中编写脚本时,它不会自动将您的脚本编码为 base64——这是所有 LCC 的要求。

我不知道您是否因同样的原因收到相同的错误 - 这似乎很普遍 - 但这对我有用。这里提到的更多详细信息:https://docs.aws.amazon.com/sagemaker/latest/dg/studio-lcc-create-cli.html

  1. 使用 AWS CLI 和必要的 sagemaker IAM 权限在系统上编写脚本并保存(示例:
    my-script.sh
  2. 通过以下方式将脚本到 Base64 编码版本的转换保存到环境变量:
LCC_CONTENT=`openssl base64 -A -in my-script.sh`
  1. 使用以下命令创建 LCC(通过 AWS CLI),传入环境变量 (
    $LCC_CONTENT
    ) 并指定正确的
    region
    和所需的
    lifecycle-config-name
    :
aws sagemaker create-studio-lifecycle-config \
--region region \
--studio-lifecycle-config-name my-lcc \
--studio-lifecycle-config-content $LCC_CONTENT \
--studio-lifecycle-config-app-type KernelGateway
  1. 然后将 LCC 重新附加到您的 sagemaker 域并尝试 agian。
© www.soinside.com 2019 - 2024. All rights reserved.