Repository: onnx/sklearn-onnx
Pull request #1034 (2023-10-12 16:33:20)

Check onnx 1.5.0 release candidate


Patch:
diff --git a/.azure-pipelines/linux-conda-CI.yml b/.azure-pipelines/linux-conda-CI.yml
index a0402d1..25aa1d2 100644
--- a/.azure-pipelines/linux-conda-CI.yml
+++ b/.azure-pipelines/linux-conda-CI.yml
@@ -14,43 +14,56 @@ jobs:
   strategy:
     matrix:
 
+      Py311-Onnx150-Rt161-Skl131:
+        do.bench: '0'
+        python.version: '3.11'
+        numpy.version: '>=1.21.1'
+        scipy.version: '>=1.7.0'
+        onnx.version: '-i https://test.pypi.org/simple/ onnx==1.15.0rc2'
+        onnx.target_opset: ''
+        onnxrt.version: 'onnxruntime==1.16.1'
+        sklearn.version: '>=1.3.1'
+        lgbm.version: ''
+        onnxcc.version: '>=1.8.1'
+        run.example: '1'
+
       Py311-Onnx141-Rt160-Skl131:
         do.bench: '0'
-        python.version: '3.11'  # onnxruntime cannot support python 3.11 yet
+        python.version: '3.11'
         numpy.version: '>=1.21.1'
         scipy.version: '>=1.7.0'
-        onnx.version: 'onnx==1.14.1' # '-i https://test.pypi.org/simple/ onnx==1.14.0rc3'
+        onnx.version: 'onnx==1.14.1'
         onnx.target_opset: ''
         onnxrt.version: 'onnxruntime==1.16.0'
         sklearn.version: '>=1.3.1'
         lgbm.version: ''
-        onnxcc.version: '>=1.8.1'  # git
+        onnxcc.version: '>=1.8.1'
         run.example: '1'
 
       Py311-Onnx140-Rt151-Skl130:
         do.bench: '0'
-        python.version: '3.11'  # onnxruntime cannot support python 3.11 yet
+        python.version: '3.11'
         numpy.version: '>=1.21.1'
         scipy.version: '>=1.7.0'
-        onnx.version: 'onnx==1.14.0' # '-i https://test.pypi.org/simple/ onnx==1.14.0rc3'
+        onnx.version: 'onnx==1.14.0'
         onnx.target_opset: ''
         onnxrt.version: 'onnxruntime==1.15.1'
         sklearn.version: '==1.3.0'
         lgbm.version: ''
-        onnxcc.version: '>=1.8.1'  # git
+        onnxcc.version: '>=1.8.1'
         run.example: '0'
 
       Py310-Onnx140-Rt140-Skl122:
         do.bench: '0'
-        python.version: '3.10'  # onnxruntime cannot support python 3.11 yet
+        python.version: '3.10'
         numpy.version: '>=1.21.1'
         scipy.version: '>=1.7.0'
-        onnx.version: 'onnx==1.14.1' # '-i https://test.pypi.org/simple/ onnx==1.14.0rc3'
+        onnx.version: 'onnx==1.14.1'
         onnx.target_opset: ''
         onnxrt.version: 'onnxruntime==1.14.0'
         sklearn.version: '==1.2.2'
         lgbm.version: ''
-        onnxcc.version: '>=1.8.1'  # git
+        onnxcc.version: '>=1.8.1'
         run.example: '0'
 
       Py310-Onnx130-Rt140-Skl121:
@@ -58,12 +71,12 @@ jobs:
         python.version: '3.10'
         numpy.version: '>=1.21.2'
         scipy.version: '>=1.7.0'
-        onnx.version: 'onnx==1.13.0' #'-i https://test.pypi.org/simple/ onnx==1.13.0rc1'
+        onnx.version: 'onnx==1.13.0'
         onnx.target_opset: ''
         onnxrt.version: 'onnxruntime==1.14.0'
         sklearn.version: '==1.2.1'
         lgbm.version: ''
-        onnxcc.version: '>=1.8.1'  # git
+        onnxcc.version: '>=1.8.1'
         run.example: '0'
 
       Py310-Onnx130-Rt131-Skl120:
@@ -71,12 +84,12 @@ jobs:
         python.version: '3.10'
         numpy.version: '>=1.21.0'
         scipy.version: '>=1.7.0'
-        onnx.version: 'onnx==1.13.0' #'-i https://test.pypi.org/simple/ onnx==1.13.0rc1'
+        onnx.version: 'onnx==1.13.0'
         onnx.target_opset: ''
         onnxrt.version: 'onnxruntime==1.13.1'
         sklearn.version: '==1.2.0'
         lgbm.version: ''
-        onnxcc.version: '>=1.8.1'  # git
+        onnxcc.version: '>=1.8.1'
         run.example: '0'
 
       Py310-Onnx120-Rt131-Skl120:
@@ -84,96 +97,96 @@ jobs:
         python.version: '3.10'
         numpy.version: '>=1.21.0'
         scipy.version: '>=1.7.0'
-        onnx.version: 'onnx==1.12.0' #'-i https://test.pypi.org/simple/ onnx==1.12.0rc4'
+        onnx.version: 'onnx==1.12.0'
         onnx.target_opset: ''
         onnxrt.version: 'onnxruntime==1.13.1'
         sklearn.version: '==1.2.0'
         lgbm.version: ''
-        onnxcc.version: '>=1.8.1'  # git
+        onnxcc.version: '>=1.8.1'
         run.example: '0'
       Py310-Onnx120-Rt1201-Skl11:
         do.bench: '0'
         python.version: '3.10'
         numpy.version: '>=1.21.0'
         scipy.version: '>=1.7.0'
-        onnx.version: 'onnx==1.12.0' #'-i https://test.pypi.org/simple/ onnx==1.12.0rc4'
+        onnx.version: 'onnx==1.12.0'
         onnx.target_opset: ''
         onnxrt.version: 'onnxruntime==1.12.1'
         sklearn.version: '==1.1.3'
         lgbm.version: ''
-        onnxcc.version: '>=1.8.1'  # git
+        onnxcc.version: '>=1.8.1'
         run.example: '0'
       Py39-Onnx120-Rt1111-Skl11:
         do.bench: '0'
         python.version: '3.9'
         numpy.version: '>=1.21.0'
         scipy.version: '>=1.7.0'
-        onnx.version: 'onnx==1.12.0' #'-i https://test.pypi.org/simple/ onnx==1.12.0rc4'
+        onnx.version: 'onnx==1.12.0'
         onnx.target_opset: ''
         onnxrt.version: 'onnxruntime==1.11.1'
         sklearn.version: '==1.1.3'
         lgbm.version: ''
-        onnxcc.version: '>=1.8.1'  # git
+        onnxcc.version: '>=1.8.1'
         run.example: '0'
       Py39-Onnx1110-Rt1111-Skl11:
         do.bench: '0'
         python.version: '3.9'
         numpy.version: '>=1.21.0'
         scipy.version: '>=1.7.0'
-        onnx.version: 'onnx==1.11.0' # '-i https://test.pypi.org/simple/ onnx==1.11.0rc2'
+        onnx.version: 'onnx==1.11.0'
         onnx.target_opset: ''
         onnxrt.version: 'onnxruntime==1.11.1'
         sklearn.version: '==1.1.3'
         lgbm.version: ''
-        onnxcc.version: '>=1.8.1'  # git
+        onnxcc.version: '>=1.8.1'
         run.example: '0'
       Py39-Onnx1110-Rt1111-Skl10:
         do.bench: '0'
         python.version: '3.9'
         numpy.version: '>=1.22.3'
         scipy.version: '>=1.7.0'
-        onnx.version: 'onnx==1.11.0' # '-i https://test.pypi.org/simple/ onnx==1.11.0rc2'
+        onnx.version: 'onnx==1.11.0'
         onnx.target_opset: ''
         onnxrt.version: 'onnxruntime==1.11.1'
         sklearn.version: '==1.0.2'
         lgbm.version: ''
-        onnxcc.version: '>=1.8.1'  # git
+        onnxcc.version: '>=1.8.1'
         run.example: '0'
       Py39-Onnx1110-Rt1100-Skl10:
         do.bench: '0'
         python.version: '3.9'
         numpy.version: '>=1.21.0'
         scipy.version: '>=1.7.0'
-        onnx.version: 'onnx==1.11.0' # '-i https://test.pypi.org/simple/ onnx==1.11.0rc2'
+        onnx.version: 'onnx==1.11.0'
         onnx.target_opset: ''
-        onnxrt.version: 'onnxruntime==1.10.0'  # '-i https://test.pypi.org/simple/ ort-nightly'
+        onnxrt.version: 'onnxruntime==1.10.0'
         sklearn.version: '==1.0.2'
         lgbm.version: ''
-        onnxcc.version: '>=1.8.1'  # git
+        onnxcc.version: '>=1.8.1'
         run.example: '0'
       Py39-Onnx1101-Rt190-Skl10:
         do.bench: '0'
         python.version: '3.9'
         numpy.version: '>=1.21.0'
         scipy.version: '>=1.7.0'
-        onnx.version: 'onnx==1.10.1'  # 'test'
+        onnx.version: 'onnx==1.10.1'
         onnx.target_opset: ''
-        onnxrt.version: 'onnxruntime==1.9.0'  # '-i https://test.pypi.org/simple/ ort-nightly'
+        onnxrt.version: 'onnxruntime==1.9.0'
         sklearn.version: '==1.0.2'
         lgbm.version: ''
-        onnxcc.version: '>=1.8.1'  # git
+        onnxcc.version: '>=1.8.1'
         run.example: '0'
       Py39-Onnx1101-Rt190-Skl0242:
         do.bench: '0'
         python.version: '3.9'
         numpy.version: '<1.21.0'
         scipy.version: ''
-        onnx.version: 'onnx==1.10.1'  # 'test'
+        onnx.version: 'onnx==1.10.1'
         onnx.target_opset: ''
-        onnxrt.version: 'onnxruntime==1.9.0'  # '-i https://test.pypi.org/simple/ ort-nightly'
+        onnxrt.version: 'onnxruntime==1.9.0'
         sklearn.version: '==0.24.2'
         lgbm.version: ''
-        onnxcc.version: '>=1.8.1'  # git
+        onnxcc.version: '>=1.8.1'
         run.example: '0'
       Py39-Onnx190-Rt180-Skl0242:
         do.bench: '0'
@@ -182,10 +195,10 @@ jobs:
         scipy.version: ''
         onnx.version: 'onnx==1.9.0'
         onnx.target_opset: ''
-        onnxrt.version: 'onnxruntime>=1.8.1'  # '-i https://test.pypi.org/simple/ ort-nightly'
+        onnxrt.version: 'onnxruntime>=1.8.1'
         sklearn.version: '==0.24.2'
         lgbm.version: ''
-        onnxcc.version: '>=1.8.1'  # git
+        onnxcc.version: '>=1.8.1'
         run.example: '0'
       Py39-Onnx190-Rt180-Skl0232:
         do.bench: '0'
@@ -194,10 +207,10 @@ jobs:
         scipy.version: ''
         onnx.version: 'onnx==1.9.0'
         onnx.target_opset: ''
-        onnxrt.version: 'onnxruntime>=1.8.1'  # '-i https://test.pypi.org/simple/ ort-nightly'
+        onnxrt.version: 'onnxruntime>=1.8.1'
         sklearn.version: '==0.23.2'
         lgbm.version: ''
-        onnxcc.version: '>=1.8.1'  # git
+        onnxcc.version: '>=1.8.1'
         run.example: '0'
 
     maxParallel: 3
diff --git a/.azure-pipelines/win32-conda-CI.yml b/.azure-pipelines/win32-conda-CI.yml
index dcd4531..1fa00bd 100644
--- a/.azure-pipelines/win32-conda-CI.yml
+++ b/.azure-pipelines/win32-conda-CI.yml
@@ -13,113 +13,122 @@ jobs:
     vmImage: 'windows-latest'
   strategy:
     matrix:
+      Py310-Onnx150-Rt161-Skl131:
+        python.version: '3.11'
+        onnx.version: '-i https://test.pypi.org/simple/ onnx==1.15.0rc2'
+        onnx.target_opset: ''
+        numpy.version: 'numpy>=1.22.3'
+        scipy.version: 'scipy'
+        onnxrt.version: 'onnxruntime==1.16.1'
+        onnxcc.version: 'onnxconverter-common>=1.8.1'
+        sklearn.version: '>=1.3.1'
       Py310-Onnx141-Rt160-Skl131:
-        python.version: '3.11'  # onnxruntime cannot support python 3.11 yet
-        onnx.version: 'onnx==1.14.1' # '-i https://test.pypi.org/simple/ onnx==1.14.0rc3'
+        python.version: '3.11'
+        onnx.version: 'onnx==1.14.1'
         onnx.target_opset: ''
         numpy.version: 'numpy>=1.22.3'
         scipy.version: 'scipy'
         onnxrt.version: 'onnxruntime==1.16.0'
-        onnxcc.version: 'onnxconverter-common>=1.8.1'  # git+https://github.com/microsoft/onnxconverter-common.git
+        onnxcc.version: 'onnxconverter-common>=1.8.1'
         sklearn.version: '>=1.3.1'
       Py310-Onnx140-Rt151-Skl130:
-        python.version: '3.11'  # onnxruntime cannot support python 3.11 yet
-        onnx.version: 'onnx==1.14.0' # '-i https://test.pypi.org/simple/ onnx==1.14.0rc3'
+        python.version: '3.11'
+        onnx.version: 'onnx==1.14.0'
         onnx.target_opset: ''
         numpy.version: 'numpy>=1.22.3'
         scipy.version: 'scipy'
         onnxrt.version: 'onnxruntime==1.15.1'
-        onnxcc.version: 'onnxconverter-common>=1.8.1'  # git+https://github.com/microsoft/onnxconverter-common.git
+        onnxcc.version: 'onnxconverter-common>=1.8.1'
         sklearn.version: '==1.3.0'
       Py310-Onnx140-Rt140-Skl122:
-        python.version: '3.10'  # onnxruntime cannot support python 3.11 yet
-        onnx.version: 'onnx==1.14.1' # '-i https://test.pypi.org/simple/ onnx==1.14.0rc3'
+        python.version: '3.10'
+        onnx.version: 'onnx==1.14.1'
         onnx.target_opset: ''
         numpy.version: 'numpy>=1.22.3'
         scipy.version: 'scipy'
         onnxrt.version: 'onnxruntime==1.14.0'
-        onnxcc.version: 'onnxconverter-common>=1.8.1'  # git+https://github.com/microsoft/onnxconverter-common.git
+        onnxcc.version: 'onnxconverter-common>=1.8.1'
         sklearn.version: '==1.2.2'
       Py310-Onnx130-Rt140-Skl121:
         python.version: '3.10'
-        onnx.version:  'onnx==1.13.0' #'-i https://test.pypi.org/simple/ onnx==1.12.0rc4'
+        onnx.version:  'onnx==1.13.0'
         onnx.target_opset: ''
         numpy.version: 'numpy>=1.22.3'
         scipy.version: 'scipy'
         onnxrt.version: 'onnxruntime==1.14.0'
-        onnxcc.version: 'onnxconverter-common>=1.8.1'  # git+https://github.com/microsoft/onnxconverter-common.git
+        onnxcc.version: 'onnxconverter-common>=1.8.1'
         sklearn.version: '==1.2.2'
       Py310-Onnx130-Rt131-Skl120:
         python.version: '3.10'
-        onnx.version:  'onnx==1.13.0' #'-i https://test.pypi.org/simple/ onnx==1.12.0rc4'
+        onnx.version:  'onnx==1.13.0'
         onnx.target_opset: ''
         numpy.version: 'numpy>=1.22.3'
         scipy.version: 'scipy'
         onnxrt.version: 'onnxruntime==1.13.1'
-        onnxcc.version: 'onnxconverter-common>=1.8.1'  # git+https://github.com/microsoft/onnxconverter-common.git
+        onnxcc.version: 'onnxconverter-common>=1.8.1'
         sklearn.version: '==1.2.0'
       Py310-Onnx120-Rt131-Skl120:
         python.version: '3.10'
-        onnx.version:  'onnx==1.12.0' #'-i https://test.pypi.org/simple/ onnx==1.12.0rc4'
+        onnx.version:  'onnx==1.12.0'
         onnx.target_opset: ''
         numpy.version: 'numpy>=1.22.3'
         scipy.version: 'scipy'
         onnxrt.version: 'onnxruntime==1.13.1'
-        onnxcc.version: 'onnxconverter-common>=1.8.1'  # git+https://github.com/microsoft/onnxconverter-common.git
+        onnxcc.version: 'onnxconverter-common>=1.8.1'
         sklearn.version: '==1.2.0'
       Py310-Onnx120-Rt120-Skl11:
         python.version: '3.10'
-        onnx.version:  'onnx==1.12.0' #'-i https://test.pypi.org/simple/ onnx==1.12.0rc4'
+        onnx.version:  'onnx==1.12.0'
         onnx.target_opset: ''
         numpy.version: 'numpy>=1.22.3'
         scipy.version: 'scipy'
         onnxrt.version: 'onnxruntime==1.12.0'
-        onnxcc.version: 'onnxconverter-common>=1.8.1'  # git+https://github.com/microsoft/onnxconverter-common.git
+        onnxcc.version: 'onnxconverter-common>=1.8.1'
         sklearn.version: '==1.1.3'
       Py39-Onnx120-Rt1111-Skl11:
         python.version: '3.9'
-        onnx.version:  'onnx==1.12.0' #'-i https://test.pypi.org/simple/ onnx==1.12.0rc4'
+        onnx.version:  'onnx==1.12.0'
         onnx.target_opset: ''
         numpy.version: 'numpy>=1.22.3'
         scipy.version: 'scipy'
         onnxrt.version: 'onnxruntime==1.11.1'
-        onnxcc.version: 'onnxconverter-common>=1.8.1'  # git+https://github.com/microsoft/onnxconverter-common.git
+        onnxcc.version: 'onnxconverter-common>=1.8.1'
         sklearn.version: '==1.1.3'
       Py39-Onnx1110-Rt1111-Skl11:
         python.version: '3.9'
-        onnx.version:  'onnx==1.11.0' # '-i https://test.pypi.org/simple/ onnx==1.11.0rc2'
+        onnx.version:  'onnx==1.11.0'
         onnx.target_opset: ''
         numpy.version: 'numpy>=1.22.3'
         scipy.version: 'scipy'
         onnxrt.version: 'onnxruntime==1.11.1'
-        onnxcc.version: 'onnxconverter-common>=1.8.1'  # git+https://github.com/microsoft/onnxconverter-common.git
+        onnxcc.version: 'onnxconverter-common>=1.8.1'
         sklearn.version: '==1.1.3'
       Py39-Onnx1110-Rt1111-Skl10:
         python.version: '3.9'
-        onnx.version:  'onnx==1.11.0' # '-i https://test.pypi.org/simple/ onnx==1.11.0rc2'
+        onnx.version:  'onnx==1.11.0'
         onnx.target_opset: ''
         numpy.version: 'numpy==1.23.5'
         scipy.version: 'scipy'
         onnxrt.version: 'onnxruntime==1.11.1'
-        onnxcc.version: 'onnxconverter-common>=1.8.1'  # git+https://github.com/microsoft/onnxconverter-common.git
+        onnxcc.version: 'onnxconverter-common>=1.8.1'
         sklearn.version: '==1.0.2'
       Py39-Onnx1110-Rt1100-Skl10:
         python.version: '3.9'
-        onnx.version:  'onnx==1.11.0' # '-i https://test.pypi.org/simple/ onnx==1.11.0rc2'
+        onnx.version:  'onnx==1.11.0'
         onnx.target_opset: ''
         numpy.version: 'numpy==1.23.5'
         scipy.version: 'scipy'
-        onnxrt.version: 'onnxruntime==1.10.0'  # -i https://test.pypi.org/simple/ ort-nightly'
-        onnxcc.version: 'onnxconverter-common>=1.8.1'  # git+https://github.com/microsoft/onnxconverter-common.git
+        onnxrt.version: 'onnxruntime==1.10.0'
+        onnxcc.version: 'onnxconverter-common>=1.8.1'
         sklearn.version: '==1.0.2'
       Py39-Onnx1102-Rt1100-Skl10:
         python.version: '3.9'
-        onnx.version: 'onnx==1.10.2'  # -i https://test.pypi.org/simple/ onnx'
+        onnx.version: 'onnx==1.10.2'
         onnx.target_opset: ''
         numpy.version: 'numpy==1.23.5'
         scipy.version: 'scipy'
-        onnxrt.version: 'onnxruntime==1.10.0'  # -i https://test.pypi.org/simple/ ort-nightly'
-        onnxcc.version: 'onnxconverter-common>=1.8.1'  # git+https://github.com/microsoft/onnxconverter-common.git
+        onnxrt.version: 'onnxruntime==1.10.0'
+        onnxcc.version: 'onnxconverter-common>=1.8.1'
         sklearn.version: '==1.0.2'
 
     maxParallel: 3
diff --git a/skl2onnx/common/utils.py b/skl2onnx/common/utils.py
index b2a98c1..3aaf1a4 100644
--- a/skl2onnx/common/utils.py
+++ b/skl2onnx/common/utils.py
@@ -173,7 +173,7 @@ def hash_array(value, length=15):
     "Computes a hash identifying the value."
     try:
         onx = from_array(value)
-    except AttributeError as e:
+    except (AttributeError, TypeError) as e:
         # sparse matrix for example
         if hasattr(value, "tocoo"):
             coo = value.tocoo()
diff --git a/skl2onnx/operator_converters/gradient_boosting.py b/skl2onnx/operator_converters/gradient_boosting.py
index 49354a4..42b5986 100644
--- a/skl2onnx/operator_converters/gradient_boosting.py
+++ b/skl2onnx/operator_converters/gradient_boosting.py
@@ -146,7 +146,10 @@ def convert_sklearn_gradient_boosting_regressor(
     elif op.init is None:
         # constant_ was introduced in scikit-learn 0.21.
         if hasattr(op.init_, "constant_"):
-            cst = [float(x) for x in op.init_.constant_]
+            if len(op.init_.constant_.shape) == 0:
+                cst = [float(op.init_.constant_)]
+            else:
+                cst = [float(x) for x in op.init_.constant_.ravel().tolist()]
         elif op.loss == "ls":
             cst = [op.init_.mean]
         else:


Test patch:
diff --git a/tests/test_algebra_onnx_operators_sparse.py b/tests/test_algebra_onnx_operators_sparse.py
index d52d50f..0a9c288 100644
--- a/tests/test_algebra_onnx_operators_sparse.py
+++ b/tests/test_algebra_onnx_operators_sparse.py
@@ -53,9 +53,10 @@ class TestOnnxOperatorsSparse(unittest.TestCase):
         reason="fails with onnxruntime < %s" % THRESHOLD,
     )
     def test_onnx_init_sparse_coo(self):
-        row = np.array([0, 0, 1, 3, 1], dtype=np.float32)
-        col = np.array([0, 2, 1, 3, 1], dtype=np.float32)
+        row = np.array([0, 0, 1, 3, 2], dtype=np.int64)
+        col = np.array([0, 2, 1, 3, 1], dtype=np.int64)
         data = np.array([1, 1, 1, 1, 1], dtype=np.float32)
+        # numpy and onnxruntime behave differently when there are duplicated indices.
         X = coo_matrix((data, (row, col)), shape=(4, 4))
 
         node = OnnxAdd("X", X, output_names=["Y"], op_version=TARGET_OPSET)
@@ -70,14 +71,14 @@ class TestOnnxOperatorsSparse(unittest.TestCase):
             # Sparse tensor is not supported for constant.
             return
         try:
-            res = sess.run(None, {"X": X})[0]
+            res = sess.run(None, {"X": X.todense()})[0]
         except RuntimeError as e:
             # Sparse tensor is not supported for constant.
             warnings.warn(
                 "Unable to run with %r\n---\n%s\n%s" % ({"X": X}, model_def, e)
             )
             return
-        assert_almost_equal(X + X, res)
+        assert_almost_equal((X + X).todense(), res)
 
 
 if __name__ == "__main__":
diff --git a/tests/test_sklearn_adaboost_converter.py b/tests/test_sklearn_adaboost_converter.py
index 25c3db9..2696fb2 100644
--- a/tests/test_sklearn_adaboost_converter.py
+++ b/tests/test_sklearn_adaboost_converter.py
@@ -368,5 +368,8 @@ class TestSklearnAdaBoostModels(unittest.TestCase):
 
 
 if __name__ == "__main__":
-    TestSklearnAdaBoostModels().test_ada_boost_classifier_samme()
+    # TestSklearnAdaBoostModels().test_ada_boost_classifier_samme()
+    import logging
+
+    logging.getLogger("skl2onnx").setLevel(logging.ERROR)
     unittest.main(verbosity=2)
diff --git a/tests/test_sklearn_bagging_converter.py b/tests/test_sklearn_bagging_converter.py
index 7135779..69fe498 100644
--- a/tests/test_sklearn_bagging_converter.py
+++ b/tests/test_sklearn_bagging_converter.py
@@ -386,6 +386,8 @@ class TestSklearnBaggingConverter(unittest.TestCase):
 
 
 if __name__ == "__main__":
-    # TestSklearnBaggingConverter().
-    # test_bagging_classifier_sgd_multiclass_decision_function()
+    import logging
+
+    logging.getLogger("skl2onnx").setLevel(logging.ERROR)
+    TestSklearnBaggingConverter().test_bagging_regressor_gradient_boosting()
     unittest.main(verbosity=2)
diff --git a/tests/test_sklearn_isolation_forest.py b/tests/test_sklearn_isolation_forest.py
index 3c1bbf1..dd072ed 100644
--- a/tests/test_sklearn_isolation_forest.py
+++ b/tests/test_sklearn_isolation_forest.py
@@ -3,6 +3,7 @@
 """
 Test scikit-learn's IsolationForest.
 """
+import logging
 import unittest
 import packaging.version as pv
 import numpy as np
@@ -109,4 +110,5 @@ class TestSklearnIsolationForest(unittest.TestCase):
 
 
 if __name__ == "__main__":
+    logging.getLogger("skl2onnx").setLevel(logging.ERROR)
     unittest.main()
diff --git a/tests/test_utils/reference_implementation_ml.py b/tests/test_utils/reference_implementation_ml.py
index 7e1ff72..7f6ffa7 100644
--- a/tests/test_utils/reference_implementation_ml.py
+++ b/tests/test_utils/reference_implementation_ml.py
@@ -5,7 +5,7 @@ from scipy.sparse import coo_matrix
 from onnx.defs import onnx_opset_version
 
 
-if onnx_opset_version() >= 18:
+if 19 >= onnx_opset_version() >= 18:
     from onnx.reference.op_run import OpRun
 
     class FusedMatMul(OpRun):
diff --git a/tests/test_utils/utils_backend_onnx.py b/tests/test_utils/utils_backend_onnx.py
index fbab210..5ccfe9c 100644
--- a/tests/test_utils/utils_backend_onnx.py
+++ b/tests/test_utils/utils_backend_onnx.py
@@ -37,10 +37,15 @@ from .utils_backend import (
 
 if onnx_opset_version() >= 18:
     from onnx.reference import ReferenceEvaluator
-    from onnx.reference.op_run import OpRun
+    from onnx.reference.op_run import OpRun, RuntimeContextError
     from onnx.reference.ops._op import OpRunReduceNumpy
-    from onnx.reference.ops import load_op
+
+    try:
+        from onnx.reference.ops.aionnxml import load_op
+    except ImportError:
+        load_op = None
     from .reference_implementation_text import Tokenizer
+    from .reference_implementation_zipmap import ZipMap
 
     class CDist(OpRun):
         op_domain = "com.microsoft"
@@ -48,17 +53,15 @@ if onnx_opset_version() >= 18:
         def _run(self, x, y, metric="euclidean"):
             return (cdist(x, y, metric=metric).astype(x.dtype),)
 
-    additional_implementations = [CDist, Tokenizer]
-
-    try:
-        load_op("ai.onnx.ml", "OneHotEncoder")
-        add_ops = False
-    except Exception:
-        add_ops = True
+    additional_implementations = [
+        CDist,
+        Tokenizer,
+        ZipMap,
+    ]
 
-    if add_ops:
+    if onnx_opset_version() < 20:
         # bugs in reference implementation not covered by a backend test
-        from onnx.reference.op_run import RuntimeContextError
+
         from onnx.reference.ops.op_argmin import _ArgMin, _argmin
         from onnx.reference.ops.op_argmax import _ArgMax, _argmax
         from onnx.reference.ops.op_reduce_log_sum_exp import compute_log_sum_exp
@@ -76,14 +79,13 @@ if onnx_opset_version() >= 18:
             OneHotEncoder,
             Scaler,
         )
-        from .reference_implementation_zipmap import ZipMap
         from .reference_implementation_afe import ArrayFeatureExtractor
+        from .reference_implementation_svm import SVMClassifier, SVMRegressor
+        from .reference_implementation_text import TfIdfVectorizer
         from .reference_implementation_tree import (
             TreeEnsembleClassifier,
             TreeEnsembleRegressor,
         )
-        from .reference_implementation_svm import SVMClassifier, SVMRegressor
-        from .reference_implementation_text import TfIdfVectorizer
 
         class ArgMin(_ArgMin):
             def _run(self, data, axis=None, keepdims=None, select_last_index=None):
@@ -212,7 +214,14 @@ if onnx_opset_version() >= 18:
                     self.cst = np.float32(0)
                 if not isinstance(
                     self.cst,
-                    (np.float32, np.float64, np.int64, np.int32, np.bool_, np.float16),
+                    (
+                        np.float32,
+                        np.float64,
+                        np.int64,
+                        np.int32,
+                        np.bool_,
+                        np.float16,
+                    ),
                 ):
                     raise TypeError(f"cst must be a real not {type(self.cst)}")
 
@@ -284,13 +293,12 @@ if onnx_opset_version() >= 18:
                 Normalizer,
                 OneHotEncoder,
                 TfIdfVectorizer,
-                TreeEnsembleClassifier,
-                TreeEnsembleRegressor,
                 Scaler,
                 Scan,
                 SVMClassifier,
                 SVMRegressor,
-                ZipMap,
+                TreeEnsembleClassifier,
+                TreeEnsembleRegressor,
             ]
         )
 
@@ -1103,7 +1111,8 @@ def _compare_expected(
                 # ReferenceEvaluator
                 res = sess.replay_run()
                 raise OnnxRuntimeAssertionError(
-                    f"Unexpected output\n---\n{res}\n----\n{msg}"
+                    f"Unexpected output\nexpected={expected.ravel()[:5]}"
+                    f"...\n---\n{res}\n----\n{msg}"
                 )
             elif verbose:
                 raise OnnxRuntimeAssertionError(