JumpStartEstimator.fit 错误:UnboundLocalError:赋值前引用局部变量“dataset_train”

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

我有一个简单的模型调整Python代码,当我运行时出现以下错误,感谢您的帮助。

错误:sagemaker.exceptions.UnexpectedStatusException:训练作业元文本生成-llama-2-7b-f-2023-11-12-03-11-41-315错误:失败。原因:AlgorithmError:ExecuteUserScriptError:ExitCode 1 ErrorMessage“UnboundLocalError:赋值前引用的局部变量'dataset_train'

这是代码片段:

estimator = JumpStartEstimator( model_id=jumpstart_model_name,model_version=jumpstart_model_version,instance_count=Instance_Count,instance_type=InstanceType,environment={"accept_eula": "true"},role=my_role,region=region_name,sagemaker_session=Sagemaker_Session,max_run =MaxTraining_Time_Sec,input_mode ="文件",output_path = s3_train_model_path,超参数= my_hyperparameters, debugger_hook_config=hook_config,tensorboard_output_config=tensorboard_output_config,)

channels = {“训练”:s3_train_data_path,“测试”:s3_test_data_path,“验证”:s3_val_data_path,}

模型调整: estimator.fit(输入=通道,日志=“全部”,等待=真)

已经尝试了很多方法,但上述错误仍然存在。

amazon-sagemaker
1个回答
0
投票

这可能是您使用的特定 model_id 的问题。
我建议从一个工作示例开始(比如这个 LLAMA2 示例),并逐渐塑造它以满足您自己的需求。
还会立即删除 debugger_hook_config (很少使用)。

© www.soinside.com 2019 - 2024. All rights reserved.