diff --git a/.azure-pipelines/linux-conda-CI.yml b/.azure-pipelines/linux-conda-CI.yml index 539a4cfe..324bde49 100644 --- a/.azure-pipelines/linux-conda-CI.yml +++ b/.azure-pipelines/linux-conda-CI.yml @@ -14,9 +14,15 @@ jobs: vmImage: 'ubuntu-latest' strategy: matrix: + Python39-1110-RT1100: + python.version: '3.9' + ONNX_PATH: onnx==1.11.0 # '-i https://test.pypi.org/simple/ onnx==1.9.101' + ONNXRT_PATH: onnxruntime==1.10.0 + COREML_PATH: git+https://github.com/apple/coremltools@3.1 + xgboost.version: '>=1.2' Python39-1101-RT190: python.version: '3.9' - ONNX_PATH: onnx==1.10.1 # '-i https://test.pypi.org/simple/ onnx==1.9.101' + ONNX_PATH: onnx==1.10.1 ONNXRT_PATH: onnxruntime==1.9.0 COREML_PATH: git+https://github.com/apple/coremltools@3.1 xgboost.version: '>=1.2' diff --git a/.azure-pipelines/win32-conda-CI.yml b/.azure-pipelines/win32-conda-CI.yml index 6792cd93..f613ec03 100644 --- a/.azure-pipelines/win32-conda-CI.yml +++ b/.azure-pipelines/win32-conda-CI.yml @@ -14,9 +14,15 @@ jobs: vmImage: 'windows-latest' strategy: matrix: - Python39-1101-RT190: + Python39-1110-RT190: python.version: '3.9' - ONNX_PATH: 'onnx==1.10.1' # '-i https://test.pypi.org/simple/ onnx==1.9.101' + ONNX_PATH: 'onnx==1.11.0' # '-i https://test.pypi.org/simple/ onnx==1.9.101' + ONNXRT_PATH: onnxruntime==1.10.0 + COREML_PATH: git+https://github.com/apple/coremltools@3.1 + + Python39-1102-RT190: + python.version: '3.9' + ONNX_PATH: 'onnx==1.10.2' # '-i https://test.pypi.org/simple/ onnx==1.9.101' ONNXRT_PATH: onnxruntime==1.9.0 COREML_PATH: git+https://github.com/apple/coremltools@3.1 diff --git a/onnxmltools/__init__.py b/onnxmltools/__init__.py index aba54e59..54127e04 100644 --- a/onnxmltools/__init__.py +++ b/onnxmltools/__init__.py @@ -5,7 +5,7 @@ This framework converts any machine learned model into onnx format which is a common language to describe any machine learned model. """ -__version__ = "1.10.0" +__version__ = "1.11.0" __author__ = "Microsoft" __producer__ = "OnnxMLTools" __producer_version__ = __version__ diff --git a/onnxmltools/convert/sparkml/operator_converters/word2vec.py b/onnxmltools/convert/sparkml/operator_converters/word2vec.py index 71456a36..67c3a710 100644 --- a/onnxmltools/convert/sparkml/operator_converters/word2vec.py +++ b/onnxmltools/convert/sparkml/operator_converters/word2vec.py @@ -28,8 +28,6 @@ def convert_word2vec(scope, operator, container): container.add_initializer(one, onnx_proto.TensorProto.INT64, [1], [1]) zero = scope.get_unique_variable_name('zero_tensor') container.add_initializer(zero, onnx_proto.TensorProto.INT64, [1], [0]) - word_count_tensor = scope.get_unique_variable_name('word_count_tensor') - container.add_initializer(word_count_tensor, onnx_proto.TensorProto.INT64, [1], [word_count]) sliced_outputs = [] for i in range(0, word_count): diff --git a/tests/lightgbm/test_LightGbmTreeEnsembleConvertersPkl.py b/tests/lightgbm/test_LightGbmTreeEnsembleConvertersPkl.py index aa204ade..0ef68882 100644 --- a/tests/lightgbm/test_LightGbmTreeEnsembleConvertersPkl.py +++ b/tests/lightgbm/test_LightGbmTreeEnsembleConvertersPkl.py @@ -17,6 +17,8 @@ TARGET_OPSET = min(DEFAULT_OPSET_NUMBER, onnx_opset_version()) +ort_version = ".".join(onnxruntime.__version__.split('.')[:2]) + class TestLightGbmTreeEnsembleModelsPkl(unittest.TestCase): @@ -37,7 +39,7 @@ def test_root_leave(self): @unittest.skipIf(sys.platform.startswith('lin'), reason="recover linux CI build, needs to be fixed") @unittest.skipIf(not hummingbird_installed(), reason="Hummingbird is not installed") @unittest.skipIf( - StrictVersion(onnxruntime.__version__) < StrictVersion('1.0.0'), reason="Hummingbird supports only latest versions of ORT" + StrictVersion(ort_version) < StrictVersion('1.0.0'), reason="Hummingbird supports only latest versions of ORT" ) def test_root_leave_onnx_only(self): this = os.path.abspath(os.path.dirname(__file__)) diff --git a/tests/lightgbm/test_LightGbmTreeEnsembleConverters_split.py b/tests/lightgbm/test_LightGbmTreeEnsembleConverters_split.py index c92816d4..c161e1fd 100644 --- a/tests/lightgbm/test_LightGbmTreeEnsembleConverters_split.py +++ b/tests/lightgbm/test_LightGbmTreeEnsembleConverters_split.py @@ -22,6 +22,7 @@ TARGET_OPSET = min(DEFAULT_OPSET_NUMBER, onnx_opset_version()) +ort_version = ".".join(ort_version.split('.')[:2]) class TestLightGbmTreeEnsembleModelsSplit(unittest.TestCase): diff --git a/tests/lightgbm/test_objective_functions.py b/tests/lightgbm/test_objective_functions.py index c85d74d7..ffb2ae7c 100644 --- a/tests/lightgbm/test_objective_functions.py +++ b/tests/lightgbm/test_objective_functions.py @@ -71,7 +71,7 @@ def _assert_almost_equal(actual: np.array, desired: np.array, decimal: int=7, fr success_rel = success_abs / len(actual) assert success_rel >= frac, f"Only {success_abs} out of {len(actual)} rows are almost equal to {decimal} decimals." - @unittest.skipIf(tuple(int(ver) for ver in onnxruntime.__version__.split(".")) < (1, 3), "not supported in this library version") + @unittest.skipIf(tuple(int(ver) for ver in onnxruntime.__version__.split(".")[:2]) < (1, 3), "not supported in this library version") def test_objective(self): """ Test if a LGBMRegressor a with certain objective (e.g. 'poisson') can be converted to ONNX diff --git a/tests/sparkml/sparkml_test_utils.py b/tests/sparkml/sparkml_test_utils.py index 18c43c86..e6a5350e 100644 --- a/tests/sparkml/sparkml_test_utils.py +++ b/tests/sparkml/sparkml_test_utils.py @@ -71,7 +71,7 @@ def save_data_models(input, expected, model, onnx_model, basename="model", folde def run_onnx_model(output_names, input, onnx_model): - sess = onnxruntime.InferenceSession(onnx_model) + sess = onnxruntime.InferenceSession(onnx_model, providers=['CPUExecutionProvider']) if isinstance(input, dict): inputs = input elif isinstance(input, list): diff --git a/tests/xgboost/test_xgboost_pipeline.py b/tests/xgboost/test_xgboost_pipeline.py index 48bab4c4..64bd81a0 100644 --- a/tests/xgboost/test_xgboost_pipeline.py +++ b/tests/xgboost/test_xgboost_pipeline.py @@ -34,6 +34,7 @@ TARGET_OPSET = min(DEFAULT_OPSET_NUMBER, onnx_opset_version()) +TARGET_OPSET_ML = 2 @unittest.skipIf(sys.version_info[:2] <= (3, 5), reason="not available") @@ -134,7 +135,7 @@ def common_test_xgboost_10_skl(self, missing, replace=False): input_xgb[input_xgb[:, :] == missing] = np.nan onnx_last = convert_sklearn(model.steps[1][-1], initial_types=[('X', FloatTensorType(shape=[None, input_xgb.shape[1]]))], - target_opset=TARGET_OPSET) + target_opset={'': TARGET_OPSET, 'ai.onnx.ml': TARGET_OPSET_ML}) session = rt.InferenceSession(onnx_last.SerializeToString()) pred_skl = model.steps[1][-1].predict(input_xgb).ravel() pred_onx = session.run(None, {'X': input_xgb})[0].ravel()