我使用VS代码在azureportal中提交了一个机器学习实验。运行实验时,我得到以下错误:
运行失败:用户程序失败,ModuleNotFoundError:没有名为“amlrun”的模块
这是代码结构:
.vscode(json配置文件)
反洗钱配置
脚本
-----amlrun.py文件(带有一些函数的脚本)
----型号_培训.py(创建和保存模型的脚本)
这是配置文件:
{
"script": "model_training.py",
"framework": "Python",
"communicator": "None",
"target": "testazure",
"environment": {
"python": {
"userManagedDependencies": false,
"condaDependencies": {
"dependencies": [
"python=3.6.2",
"scikit-learn",
"numpy",
"pandas",
{
"pip": [
"azureml-defaults"
]
}
]
}
},
"docker": {
"baseImage": "mcr.microsoft.com/azureml/base:0.2.4",
"enabled": true,
"baseImageRegistry": {
"address": null,
"username": null,
"password": null
}
}
},
"history": {
"outputCollection": true,
"snapshotProject": false,
"directoriesToWatch": [
"logs"
]
}
}
我错过什么了吗? 谢谢
当您的培训脚本在azure中运行时,它无法找到所有本地导入,即
amlrun.py
脚本。你知道吗提交给azure的培训作业首先用您的文件构建一个docker映像并运行实验;但是在本例中,扩展没有包含
amlrun.py
。你知道吗这可能是因为在提交带有扩展名的培训作业时,打开的VisualStudio代码窗口没有指向
scripts
文件夹。你知道吗摘自对previously raised github issue的回复之一:
要解决此问题,您可以执行以下操作之一:
您需要在
scripts
文件夹而不是父目录中重新打开VisualStudio代码。将
script
目录中的所有文件移到其父目录中。如果您正在寻找更灵活的方法来提交培训作业和管理aml,那么可以使用azure machine learning sdkfor python。你知道吗
使用SDK管理过期的一些示例可以在以下链接中找到:
Scikit Learn Model Training Docs
Basic Pytorch Model Training and Deployment Example Repo
相关问题 更多 >
编程相关推荐