在 Sagemaker 上开始训练任务时出现 ModuleNotFoundError

0

【以下的问题经过翻译处理】 我想在 sagemaker 上提交训练任务。我在笔记本上试过,效果很好。当我尝试以下操作时,我得到ModuleNotFoundError: No module named 'nltk'

我的代码是

import sagemaker  
from sagemaker.pytorch import PyTorch

JOB_PREFIX   = 'pyt-ic'
FRAMEWORK_VERSION = '1.3.1'

estimator = PyTorch(entry_point='finetune-T5.py',
                   source_dir='../src',
                   train_instance_type='ml.p2.xlarge' ,
                   train_instance_count=1,
                   role=sagemaker.get_execution_role(),
                   framework_version=FRAMEWORK_VERSION, 
                   debugger_hook_config=False,  
                   py_version='py3',
                   base_job_name=JOB_PREFIX)

estimator.fit()

finetune-T5.py 有许多其他未安装的库。如何安装缺少的库?或者有更好的方法来运行训练任务吗?

profile picture
ESPERTO
posta 8 mesi fa31 visualizzazioni
1 Risposta
0

【以下的回答经过翻译处理】 查看此 链接(使用第三方库部分)了解如何安装用于训练任务的第三方库。您需要在与训练脚本相同的目录中创建 requirement.txt 文件,以便在运行时安装其他依赖项。

profile picture
ESPERTO
con risposta 8 mesi fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande