Azure ML Web服务批处理执行错误 [英] Azure ML Web Service Batch Execution Error
问题描述
我使用python使用logistic回归训练了经典的鸢尾花分类器,并在Azure ML中进行了实验,然后将该模型(序列化泡菜版本)部署为Web服务.当我以批处理执行模式调用Web服务并运行时 提供的python脚本,我在python控制台上收到以下错误:
I trained a classic iris flower classifier using logistic regression using python and set up the experiment in Azure ML and then deployed the model (serialized pickle version) as a web service. When I call the web service in batch execution mode and run the provided python script I get the following error on my python console:
[ModuleOutput]错误:错误0085:在脚本评估期间发生以下错误,请查看输出日志以获取更多信息:
[ModuleOutput] ----------来自Python解释器的错误消息开始----------
[ModuleOutput]执行函数时捕获异常:追溯(最近一次调用为last):
[ModuleOutput] 批量处理文件"C:\ server \ invokepy.py",第199行
[ModuleOutput] odfs = mod.azureml_main(* idfs)
[ModuleOutput] azureml_main中的文件"C:\ temp \ 9e59950f60724301be923b442c66b4e5.py",第23行
[ModuleOutput] pred = model.predict(dataframe1)
[ModuleOutput] 预测中的文件"C:\ pyhome \ lib \ site-packages \ sklearn \ linear_model \ base.py",第268行
[ModuleOutput] 分数= self.decision_function(X)
[ModuleOutput] Decision_function中的文件"C:\ pyhome \ lib \ site-packages \ sklearn \ linear_model \ base.py",第244行
[ModuleOutput] X = check_array(X,accept_sparse ='csr')
[ModuleOutput] 在check_array中的文件"C:\ pyhome \ lib \ site-packages \ sklearn \ utils \ validation.py",第393行
[ModuleOutput] 数组= array.astype(np.float64)
[ModuleOutput] ValueError:无法将字符串转换为float:'virginica'
[ModuleOutput]返回的非零退出代码1的进程
[ModuleOutput]
[ModuleOutput] ----------来自Python的错误消息结束口译员----------
[ModuleOutput] Error: Error 0085: The following error occurred during script evaluation, please view the output log for more information:
[ModuleOutput] ---------- Start of error message from Python interpreter ----------
[ModuleOutput] Caught exception while executing function: Traceback (most recent call last):
[ModuleOutput] File "C:\server\invokepy.py", line 199, in batch
[ModuleOutput] odfs = mod.azureml_main(*idfs)
[ModuleOutput] File "C:\temp\9e59950f60724301be923b442c66b4e5.py", line 23, in azureml_main
[ModuleOutput] pred = model.predict(dataframe1)
[ModuleOutput] File "C:\pyhome\lib\site-packages\sklearn\linear_model\base.py", line 268, in predict
[ModuleOutput] scores = self.decision_function(X)
[ModuleOutput] File "C:\pyhome\lib\site-packages\sklearn\linear_model\base.py", line 244, in decision_function
[ModuleOutput] X = check_array(X, accept_sparse='csr')
[ModuleOutput] File "C:\pyhome\lib\site-packages\sklearn\utils\validation.py", line 393, in check_array
[ModuleOutput] array = array.astype(np.float64)
[ModuleOutput] ValueError: could not convert string to float: 'virginica'
[ModuleOutput] Process returned with non-zero exit code 1
[ModuleOutput]
[ModuleOutput] ---------- End of error message from Python interpreter ----------
任何人都可以解释此错误吗?为什么Web服务期望所有输入都是浮点型的?目标应该是绝对的.并且在请求-响应模式下,Web服务可以正常工作并输出一种物种(setosa,versicolor或virginica).
Can anyone explain this error? Why is web service expecting all inputs to be of float type? The target should be categorical. And in request-response mode the web service works fine and outputs a species (setosa, versicolor, or virginica).
谢谢
推荐答案
能否请您分享更多代码细节,以便我们进行调查?
Can you please share more details of your code so that we can look into it?
此致
雨桐
这篇关于Azure ML Web服务批处理执行错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!