简体   繁体   English

如何在推理脚本中给出 azure 机器学习数据集路径?

[英]How give azure machine learning dataset path in an inference script?

I am using azureml sdk in Azure Databricks.我在 Azure Databricks 中使用 azureml sdk。

When I write the script for inference model (%%writefile script.py) in a databricks cell, I try to load a.bin file that I loaded in Azure Machine Learning Datasets.当我在数据块单元格中编写用于推理 model (%%writefile script.py) 的脚本时,我尝试加载我在 Azure 机器学习数据集中加载的 .bin 文件。

I would like to do this in the script.py:我想在 script.py 中这样做:

fasttext.load_model(azuremldatasetpath)

How can I do to give good dataset path of my.bin file in azuremldatasetpath variable?如何在 azuremldatasetpath 变量中提供 my.bin 文件的良好数据集路径? (Without calling workspace in the script). (无需在脚本中调用工作区)。

Something like:就像是:

dataset_path = os.path.join(os.getenv('AZUREML_MODEL_DIR'), 'file.bin')

You can use your model name with the Model.get_model_path() method to retrieve the path of the model file or files on the local file system.您可以使用您的 model 名称和Model.get_model_path()方法来检索本地文件系统上 model 文件的路径。 If you register a folder or a collection of files, this API returns the path of the directory that contains those files.如果注册文件夹或文件集合,则此 API 返回包含这些文件的目录的路径。

More info you may want to refer: https://learn.microsoft.com/en-us/azure/machine-learning/how-to-deploy-advanced-entry-script#azureml_model_dir更多信息你可能想参考: https://learn.microsoft.com/en-us/azure/machine-learning/how-to-deploy-advanced-entry-script#azureml_model_dir

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何为管道作业期间上传的 Azure 机器学习格式化 MLTable 中的文件路径? - How to format the file path in an MLTable for Azure Machine Learning uploaded during a pipeline job? 无法在运行于 Azure 机器学习实验的脚本中的 python 中安装 python-dotenv - unable to install python-dotenv in python in script running on Azure Machine Learning experiment Azure 机器学习笔记本:ModuleNotFound 错误 - Azure Machine Learning notebooks: ModuleNotFound error 如何将Azure机器学习工作室/数据标签中的标签数据连接到Power BI? - How to connect labeled data in Azure Machine Learning Studio/Data Labeling to Power BI? Azure 机器学习是否对计算实例收费,即使它们已停止? - Does Azure Machine Learning charge for Compute Instances even when they are stopped? Azure Devops 服务负责人和 Azure 机器学习工作区 - Azure Devops Service Principal with Azure Machine Learning Workspace Azure 机器学习计算 - 模板属性 - 附加操作所需的属性 - Azure Machine Learning Computes - Template properties - Required properties for attach operation Azure 机器学习笔记本上的错误:DataFrame 的真值不明确 - Errors on Azure Machine Learning notebooks: The truth value of a DataFrame is ambiguous Azure 机器学习无法从输出文件夹加载 pytorch Model - Azure machine learning unable to load pytorch Model from the outputs folder 如何使用 az ml cli 获取在 Azure 机器学习服务 Model 注册表中注册的最新版本的 Model ID? - How to get Model ID of the Latest Version registered in Azure Machine Learning Service Model Registry using az ml cli?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM