简体   繁体   English

为什么我在 python 中收到此错误-> NameError: name 'FloatTensorType' is not defined

[英]Why am I getting this error in python--> NameError: name 'FloatTensorType' is not defined

 initial_type = [('numfeat', FloatTensorType([None, 3])), ('strfeat', StringTensorType([None, 2]))] model_onnx = convert_sklearn(model, initial_types=initial_type)

Why am I getting the error NameError: name 'FloatTensorType' is not defined in python?为什么我收到错误 NameError: name 'FloatTensorType' is not defined in python?

You have to import FloatTensorType:您必须导入 FloatTensorType:

from onnxmltools.convert.sparkml.utils import FloatTensorType

Double check versions of all installed ONNX libraries.仔细检查所有已安装 ONNX 库的版本。 They should be > 1.7.0它们应该 > 1.7.0

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

相关问题 为什么我会收到“NameError: name 'df2' is not defined”错误? - Why am i getting “ NameError: name 'df2' is not defined” error? 为什么我收到此错误“NameError:name'self'未定义。” - Why am I getting this error “NameError:name 'self' is not defined.” NameError:未定义全局名称,为什么会收到该错误? - NameError: global name is not defined, why am I getting that error? 为什么会出现以下错误:NameError:未定义名称'models' - Why am I getting the following error: NameError: name 'models' is not defined Python 3.5:我收到一个错误:“ NameError:未定义名称'multiprocessing'” - Python 3.5: I am getting an error: “NameError: name 'multiprocessing' is not defined” 为什么我得到这个 NameError: name "dt' is not defined - Why am I getting this NameError: name "dt' is not defined 为什么我得到NameError:没有定义全局名称'spacing' - why am i getting NameError: global name 'spacing' is not defined 为什么我会得到这个? “NameError:名称'响应'未定义” - Why am I getting this? “NameError: name 'Response' is not defined” 为什么会收到(NameError:未定义全局名称“ secondRoom”)? - Why am I getting (NameError: global name 'secondRoom' is not defined)? 为什么会出现NameError:未定义名称'array' - Why am I getting NameError: name 'array' is not defined
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM