在 Azure 笔记本中使用远程 Azure 自动机器学习模型时导入错误

Import error when using remote Azure Automated Machine Learning model in Azure notebook

我已经在 Azure ML 计算集群上训练了一个自动化机器学习模型。

我正在尝试在我的 Azure 托管 Jupyter 笔记本中使用该远程模型。

这是工作簿中尝试加载远程模型的代码:

remote_run = AutoMLRun(experiment = experiment, run_id = '... Experiment id ...')
remote_best_run, remote_fitted_model = remote_run.get_output()

此代码失败并出现以下错误:

ModuleNotFoundError Traceback (most recent call last) in 2 # remote_run.wait_for_completion(show_output = True) 3 import pandas as pd ----> 4 remote_best_run, remote_fitted_model = remote_run.get_output() 5 #!pip list

~/anaconda3_501/lib/python3.6/site-packages/azureml/train/automl/run.py in get_output(self, iteration, metric) 406 407 with open(model_local, "rb") as model_file: --> 408 fitted_model = pickle.load(model_file) 409 return curr_run, fitted_model 410

ModuleNotFoundError: No module named 'pandas._libs.tslibs.timestamps'

据推测,安装在 Azure ML 计算集群上的版本与安装在 Jupyter notebook 内核中的版本不同,或者我缺少一个包。

我怎样才能让这个远程模型工作?

作为额外参考,我正在学习本教程:https://notebooks.azure.com/NileshA/projects/GlobalAI

注意 1 我也可以通过 运行 在我的 jupyter notebook 中使用以下代码重现此错误:

import pickle

with open('model.pkl', 'rb') as p_f:
    data = pickle.load(p_f)

我给 Auto ML 服务台发了邮件,他们解决了这个问题。

引用他们的话:

We have a bug where the AutoML inferencing fails because the pandas version is 0.22.0 which doesn’t have some API support.

我将托管笔记本上的 pandas 升级到版本 0.23.4,此后模型成功运行