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?
You have to import FloatTensorType:
from onnxmltools.convert.sparkml.utils import FloatTensorType
Double check versions of all installed ONNX libraries. They should be > 1.7.0
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.