diff --git a/.azure-pipelines/linux-conda-CI.yml b/.azure-pipelines/linux-conda-CI.yml index e313ce2c2..8e049cae6 100644 --- a/.azure-pipelines/linux-conda-CI.yml +++ b/.azure-pipelines/linux-conda-CI.yml @@ -26,7 +26,7 @@ jobs: Py39-Onnx1101-Rt190-Skl0242: do.bench: '0' python.version: '3.9' - numpy.version: '>=1.18.1' + numpy.version: '<1.21.0' onnx.version: '==1.10.1' # 'test' onnx.target_opset: '' onnxrt.version: 'onnxruntime==1.9.0' # '-i https://test.pypi.org/simple/ ort-nightly' @@ -36,17 +36,17 @@ jobs: Py39-Onnx1101-Rt181-Skl0242: do.bench: '0' python.version: '3.9' - numpy.version: '>=1.18.1' + numpy.version: '<1.21.0' onnx.version: '==1.10.1' # 'test' onnx.target_opset: '' onnxrt.version: 'onnxruntime==1.8.1' # '-i https://test.pypi.org/simple/ ort-nightly' - sklearn.version: '>=0.24.2' + sklearn.version: '>=0.24.2 lightgbm==3.2.0' onnxcc.version: '>=1.8.1' # git run.example: '0' Py39-Onnx190-Rt180-Skl0242: do.bench: '0' python.version: '3.9' - numpy.version: '>=1.18.1' + numpy.version: '<1.21.0' onnx.version: '==1.9.0' onnx.target_opset: '' onnxrt.version: 'onnxruntime>=1.8.1' # '-i https://test.pypi.org/simple/ ort-nightly' @@ -56,7 +56,7 @@ jobs: Py39-Onnx190-Rt170-Skl0242: do.bench: '0' python.version: '3.9' - numpy.version: '>=1.18.1' + numpy.version: '<1.21.0' onnx.version: '==1.9.0' onnx.target_opset: '' onnxrt.version: 'onnxruntime==1.7.0' # '-i https://test.pypi.org/simple/ ort-nightly' @@ -66,7 +66,7 @@ jobs: Py38-Onnx181-Rt170-Skl0242: do.bench: '0' python.version: '3.8' - numpy.version: '>=1.18.1' + numpy.version: '<1.21.0' onnx.version: '==1.8.1' onnx.target_opset: '' onnxrt.version: 'onnxruntime==1.7.0' # '-i https://test.pypi.org/simple/ ort-nightly' @@ -76,7 +76,7 @@ jobs: Py38-Onnx181-Rt170-Skl0241: do.bench: '0' python.version: '3.8' - numpy.version: '>=1.18.1' + numpy.version: '<1.21.0' onnx.version: '==1.8.1' onnx.target_opset: '' onnxrt.version: 'onnxruntime==1.7.0' # '-i https://test.pypi.org/simple/ ort-nightly' @@ -86,7 +86,7 @@ jobs: Py38-Onnx181-Rt160-Skl0240: do.bench: '0' python.version: '3.8' - numpy.version: '>=1.18.1' + numpy.version: '<1.21.0' onnx.version: '==1.8.1' onnx.target_opset: '' onnxrt.version: 'onnxruntime==1.6.0' @@ -96,7 +96,7 @@ jobs: Py38-Onnx170-Rt160-Skl0240: do.bench: '0' python.version: '3.8' - numpy.version: '>=1.18.1' + numpy.version: '<1.21.0' onnx.version: '==1.7.0' onnx.target_opset: '' onnxrt.version: 'onnxruntime==1.6.0' @@ -106,7 +106,7 @@ jobs: Py37-Onnx170-Rt151-Skl0232: do.bench: '0' python.version: '3.7' - numpy.version: '>=1.18.1' + numpy.version: '<1.21.0' onnx.version: '==1.7.0' onnx.target_opset: '' onnxrt.version: 'onnxruntime==1.5.1' @@ -116,7 +116,7 @@ jobs: Py37-Onnx170-Rt140-Skl0232: do.bench: '0' python.version: '3.7' - numpy.version: '>=1.18.1' + numpy.version: '<1.21.0' onnx.version: '==1.7.0' onnx.target_opset: '' onnxrt.version: 'onnxruntime==1.4.0' # '-i https://test.pypi.org/simple/ ort-nightly' @@ -126,7 +126,7 @@ jobs: Py37-Onnx170-Rt130-Skl0231: do.bench: '0' python.version: '3.7' - numpy.version: '>=1.18.1' + numpy.version: '<1.21.0' onnx.version: '==1.7.0' onnx.target_opset: '' onnxrt.version: 'onnxruntime==1.3.0' @@ -136,7 +136,7 @@ jobs: Py37-Onnx170-Rt120-Skl0230-Op11: do.bench: '0' python.version: '3.7' - numpy.version: '>=1.18.1' + numpy.version: '<1.21.0' onnx.version: '==1.7.0' onnx.target_opset: '11' onnxrt.version: 'onnxruntime==1.2.0' @@ -146,7 +146,7 @@ jobs: Py37-Onnx160-Rt120-Skl0230: do.bench: '0' python.version: '3.7' - numpy.version: '>=1.18.1' + numpy.version: '<1.21.0' onnx.version: '==1.6.0' onnx.target_opset: '' onnxcc.version: '==1.7.0' @@ -156,7 +156,7 @@ jobs: Py37-Onnx160-Rt111-Skl0222: do.bench: '0' python.version: '3.7' - numpy.version: '>=1.18.1' + numpy.version: '<1.21.0' onnx.version: '==1.6.0' onnx.target_opset: '' onnxcc.version: '==1.7.0' @@ -166,7 +166,7 @@ jobs: Py37-Onnx160-Rt100-Skl0213: do.bench: '0' python.version: '3.7' - numpy.version: '==1.18.1' + numpy.version: '<1.21.0' onnx.version: '==1.6.0' onnx.target_opset: '' onnxcc.version: '==1.7.0' diff --git a/skl2onnx/__init__.py b/skl2onnx/__init__.py index 7c1437cf8..738a957a8 100644 --- a/skl2onnx/__init__.py +++ b/skl2onnx/__init__.py @@ -3,7 +3,7 @@ """ Main entry point to the converter from the *scikit-learn* to *onnx*. """ -__version__ = "1.10.0" +__version__ = "1.10.1" __author__ = "Microsoft" __producer__ = "skl2onnx" __producer_version__ = __version__ diff --git a/tests/test_sklearn_custom_nmf.py b/tests/test_sklearn_custom_nmf.py index b9913314f..3961ed138 100644 --- a/tests/test_sklearn_custom_nmf.py +++ b/tests/test_sklearn_custom_nmf.py @@ -21,10 +21,10 @@ class TestSklearnCustomNMF(unittest.TestCase): def test_custom_nmf(self): mat = np.array([[1, 0, 0, 0], [1, 0, 0, 0], [1, 0, 0, 0], - [1, 0, 0, 0], [1, 0, 0, 0]], dtype=np.float64) + [1, 0, 0, 0], [0, 0, 0, 1]], dtype=np.float64) mat[:mat.shape[1], :] += np.identity(mat.shape[1]) - mod = NMF(n_components=2) + mod = NMF(n_components=2, max_iter=2) W = mod.fit_transform(mat) H = mod.components_ diff --git a/tests/test_sklearn_double_tensor_type_tr.py b/tests/test_sklearn_double_tensor_type_tr.py index b8b71fc8d..83ef2183d 100644 --- a/tests/test_sklearn_double_tensor_type_tr.py +++ b/tests/test_sklearn_double_tensor_type_tr.py @@ -33,6 +33,7 @@ ORT_VERSION = "1.7.0" OPSET_VERSION = 11 +ort_version = ".".join(ort_version.split('.')[:2]) class TestSklearnDoubleTensorTypeTransformer(unittest.TestCase): @@ -458,7 +459,7 @@ def _fit_model_pca(model): model.fit(X_train) return model, X_test.astype(np.float64) - model, X_test = _fit_model_pca(PCA(random_state=42)) + model, X_test = _fit_model_pca(PCA(random_state=42, n_components=2)) model_onnx = convert_sklearn( model, initial_types=[ ("input", DoubleTensorType([None, X_test.shape[1]]))], diff --git a/tests/test_sklearn_glm_classifier_converter.py b/tests/test_sklearn_glm_classifier_converter.py index ab1f8d474..d8287070f 100644 --- a/tests/test_sklearn_glm_classifier_converter.py +++ b/tests/test_sklearn_glm_classifier_converter.py @@ -129,7 +129,7 @@ def test_model_logistic_linear_discriminant_analysis(self): X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]]) y = np.array([1, 1, 1, 2, 2, 2]) X_test = np.array([[-0.8, -1], [-2, -1]], dtype=np.float32) - model = LinearDiscriminantAnalysis().fit(X, y) + model = LinearDiscriminantAnalysis(n_components=1).fit(X, y) model_onnx = convert_sklearn( model, "linear model", [("input", FloatTensorType([None, X_test.shape[1]]))], diff --git a/tests/test_sklearn_kernel_pca_converter.py b/tests/test_sklearn_kernel_pca_converter.py index c190902db..44dec15dc 100644 --- a/tests/test_sklearn_kernel_pca_converter.py +++ b/tests/test_sklearn_kernel_pca_converter.py @@ -18,6 +18,9 @@ from test_utils import dump_data_and_model, TARGET_OPSET +ort_version = ".".join(ort_version.split('.')[:2]) + + class TestSklearnKernelPCAConverter(unittest.TestCase): def _fit_model(self, model, dtype=np.float32): @@ -47,7 +50,7 @@ def test_kernel_pca_default_float(self): @ignore_warnings(category=(FutureWarning, DeprecationWarning)) def test_kernel_pca_default_double(self): model, X_test = self._fit_model( - KernelPCA(random_state=42), dtype=np.float64) + KernelPCA(random_state=42, n_components=2), dtype=np.float64) model_onnx = to_onnx(model, X_test, target_opset=TARGET_OPSET) dump_data_and_model( X_test, model, model_onnx, diff --git a/tests/test_sklearn_nearest_neighbour_converter.py b/tests/test_sklearn_nearest_neighbour_converter.py index ac93afb44..57291c09e 100644 --- a/tests/test_sklearn_nearest_neighbour_converter.py +++ b/tests/test_sklearn_nearest_neighbour_converter.py @@ -11,8 +11,7 @@ import numpy from numpy.testing import assert_almost_equal import onnx -import onnxruntime -from onnxruntime import InferenceSession +from onnxruntime import InferenceSession, __version__ as ort_version from pandas import DataFrame try: from sklearn.utils._testing import ignore_warnings @@ -60,10 +59,13 @@ def dont_test_radius(): return ( - StrictVersion(onnxruntime.__version__) <= StrictVersion("1.3.0") or + StrictVersion(ort_version) <= StrictVersion("1.3.0") or StrictVersion(onnx.__version__) <= StrictVersion("1.6.0")) +ort_version = ".".join(ort_version.split('.')[:2]) + + class TestNearestNeighbourConverter(unittest.TestCase): @functools.lru_cache(maxsize=1) @@ -111,7 +113,7 @@ def _fit_model_simple(self, model, n_targets=1, label_int=False, return model, X @unittest.skipIf( - StrictVersion(onnxruntime.__version__) < StrictVersion("0.5.0"), + StrictVersion(ort_version) < StrictVersion("0.5.0"), reason="not available") @ignore_warnings(category=DeprecationWarning) def test_model_knn_regressor(self): @@ -131,7 +133,7 @@ def test_model_knn_regressor(self): @unittest.skipIf(dont_test_radius(), reason="not available") @unittest.skipIf( - StrictVersion(onnxruntime.__version__) < StrictVersion("1.8.0"), + StrictVersion(ort_version) < StrictVersion("1.8.0"), reason="produces nan values") @ignore_warnings(category=DeprecationWarning) def test_model_knn_regressor_radius(self): @@ -157,14 +159,14 @@ def test_model_knn_regressor_radius(self): None, {'input': X.astype(numpy.float32)}) rows.append('--{}--'.format(out)) rows.append(str(res)) - if (StrictVersion(onnxruntime.__version__) < + if (StrictVersion(ort_version) < StrictVersion("1.4.0")): return raise AssertionError('\n'.join(rows)) assert_almost_equal(exp.ravel(), got.ravel(), decimal=3) @unittest.skipIf( - StrictVersion(onnxruntime.__version__) < StrictVersion("0.5.0"), + StrictVersion(ort_version) < StrictVersion("0.5.0"), reason="not available") @unittest.skipIf( StrictVersion(onnx.__version__) < StrictVersion("1.6.0"), @@ -193,7 +195,7 @@ def test_model_knn_regressor_double(self): @unittest.skipIf(dont_test_radius(), reason="not available") @unittest.skipIf( - StrictVersion(onnxruntime.__version__) < StrictVersion("1.7.0"), + StrictVersion(ort_version) < StrictVersion("1.7.0"), reason="nan may happen during computation") @ignore_warnings(category=DeprecationWarning) def test_model_knn_regressor_double_radius(self): @@ -214,7 +216,7 @@ def test_model_knn_regressor_double_radius(self): basename="SklearnRadiusNeighborsRegressor64") @unittest.skipIf( - StrictVersion(onnxruntime.__version__) < StrictVersion("0.5.0"), + StrictVersion(ort_version) < StrictVersion("0.5.0"), reason="not available") @ignore_warnings(category=DeprecationWarning) def test_model_knn_regressor_yint(self): @@ -244,7 +246,7 @@ def test_model_knn_regressor_yint_radius(self): basename="SklearnRadiusNeighborsRegressorYInt") @unittest.skipIf( - StrictVersion(onnxruntime.__version__) < StrictVersion("0.5.0"), + StrictVersion(ort_version) < StrictVersion("0.5.0"), reason="not available") @ignore_warnings(category=DeprecationWarning) def test_model_knn_regressor2_1(self): @@ -292,8 +294,8 @@ def test_model_knn_regressor2_1_radius(self): None, {'input': X.astype(numpy.float32)}) rows.append('--{}--'.format(out)) rows.append(str(res)) - if (onnxruntime.__version__.startswith('1.4.') or - onnxruntime.__version__.startswith('1.5.')): + if (ort_version.startswith('1.4.') or + ort_version.startswith('1.5.')): # TODO: investigate the regression in onnxruntime 1.4 # One broadcasted multiplication unexpectedly produces nan. whole = '\n'.join(rows) @@ -301,7 +303,7 @@ def test_model_knn_regressor2_1_radius(self): warnings.warn(whole) return raise AssertionError(whole) - if (onnxruntime.__version__.startswith('1.3.') and + if (ort_version.startswith('1.3.') and sys.platform == 'win32'): # Same error but different line number for further # investigation. @@ -310,7 +312,7 @@ def test_model_knn_regressor2_1_radius(self): assert_almost_equal(exp, got, decimal=5) @unittest.skipIf( - StrictVersion(onnxruntime.__version__) < StrictVersion("0.5.0"), + StrictVersion(ort_version) < StrictVersion("0.5.0"), reason="not available") @unittest.skipIf( StrictVersion(onnx.__version__) < StrictVersion("1.4.0"), @@ -334,7 +336,7 @@ def test_model_knn_regressor2_1_opset(self): basename="SklearnKNeighborsRegressor2%d" % op) @unittest.skipIf( - StrictVersion(onnxruntime.__version__) < StrictVersion("0.5.0"), + StrictVersion(ort_version) < StrictVersion("0.5.0"), reason="not available") @ignore_warnings(category=DeprecationWarning) def test_model_knn_regressor2_2(self): @@ -350,7 +352,7 @@ def test_model_knn_regressor2_2(self): basename="SklearnKNeighborsRegressor2") @unittest.skipIf( - StrictVersion(onnxruntime.__version__) < StrictVersion("0.5.0"), + StrictVersion(ort_version) < StrictVersion("0.5.0"), reason="not available") @unittest.skipIf(TARGET_OPSET < 9, reason="needs higher target_opset") @@ -406,7 +408,7 @@ def test_model_knn_regressor_weights_distance_11_radius(self): assert_almost_equal(exp, got.ravel(), decimal=3) @unittest.skipIf( - StrictVersion(onnxruntime.__version__) < StrictVersion("0.5.0"), + StrictVersion(ort_version) < StrictVersion("0.5.0"), reason="not available") @ignore_warnings(category=DeprecationWarning) def test_model_knn_regressor_metric_cityblock(self): @@ -423,7 +425,7 @@ def test_model_knn_regressor_metric_cityblock(self): @unittest.skipIf(not onnx_built_with_ml(), reason="Requires ONNX-ML extension.") @unittest.skipIf( - StrictVersion(onnxruntime.__version__) < StrictVersion("0.5.0"), + StrictVersion(ort_version) < StrictVersion("0.5.0"), reason="not available") @unittest.skipIf(TARGET_OPSET < TARGET_OPSET, reason="needs higher target_opset") @@ -463,7 +465,7 @@ def test_model_knn_classifier_binary_class_radius(self): @unittest.skipIf(not onnx_built_with_ml(), reason="Requires ONNX-ML extension.") @unittest.skipIf( - StrictVersion(onnxruntime.__version__) < StrictVersion("0.5.0"), + StrictVersion(ort_version) < StrictVersion("0.5.0"), reason="not available") @ignore_warnings(category=DeprecationWarning) def test_model_knn_classifier_multi_class(self): @@ -502,7 +504,7 @@ def test_model_knn_classifier_multi_class_radius(self): @unittest.skipIf(not onnx_built_with_ml(), reason="Requires ONNX-ML extension.") @unittest.skipIf( - StrictVersion(onnxruntime.__version__) < StrictVersion("0.5.0"), + StrictVersion(ort_version) < StrictVersion("0.5.0"), reason="not available") @ignore_warnings(category=DeprecationWarning) def test_model_knn_classifier_multi_class_string(self): @@ -521,7 +523,7 @@ def test_model_knn_classifier_multi_class_string(self): basename="SklearnKNeighborsClassifierMulti") @unittest.skipIf( - StrictVersion(onnxruntime.__version__) < StrictVersion("0.5.0"), + StrictVersion(ort_version) < StrictVersion("0.5.0"), reason="not available") @ignore_warnings(category=DeprecationWarning) def test_model_knn_classifier_weights_distance(self): @@ -536,7 +538,7 @@ def test_model_knn_classifier_weights_distance(self): basename="SklearnKNeighborsClassifierWeightsDistance") @unittest.skipIf( - StrictVersion(onnxruntime.__version__) < StrictVersion("0.5.0"), + StrictVersion(ort_version) < StrictVersion("0.5.0"), reason="not available") @ignore_warnings(category=DeprecationWarning) def test_model_knn_classifier_metric_cityblock(self): @@ -551,7 +553,7 @@ def test_model_knn_classifier_metric_cityblock(self): basename="SklearnKNeighborsClassifierMetricCityblock") @unittest.skipIf( - StrictVersion(onnxruntime.__version__) < StrictVersion("0.5.0"), + StrictVersion(ort_version) < StrictVersion("0.5.0"), reason="not available") @ignore_warnings(category=DeprecationWarning) def test_model_knn_classifier_multilabel(self): @@ -571,7 +573,7 @@ def test_model_knn_classifier_multilabel(self): basename="SklearnKNNClassifierMultiLabel-Out0") @unittest.skipIf( - StrictVersion(onnxruntime.__version__) < StrictVersion("0.5.0"), + StrictVersion(ort_version) < StrictVersion("0.5.0"), reason="not available") @ignore_warnings(category=DeprecationWarning) def test_model_knn_regressor_int(self): @@ -591,7 +593,7 @@ def test_model_knn_regressor_int(self): ) @unittest.skipIf( - StrictVersion(onnxruntime.__version__) < StrictVersion("0.5.0"), + StrictVersion(ort_version) < StrictVersion("0.5.0"), reason="not available") @ignore_warnings(category=DeprecationWarning) def test_model_knn_regressor_equal(self): @@ -625,7 +627,7 @@ def test_model_knn_regressor_equal(self): # assert_almost_equal(exp, res) @unittest.skipIf( - StrictVersion(onnxruntime.__version__) < StrictVersion("0.5.0"), + StrictVersion(ort_version) < StrictVersion("0.5.0"), reason="not available") @ignore_warnings(category=DeprecationWarning) def test_model_knn_multi_class_nocl(self): @@ -646,7 +648,7 @@ def test_model_knn_multi_class_nocl(self): basename="SklearnKNNMultiNoCl", verbose=False) @unittest.skipIf( - StrictVersion(onnxruntime.__version__) < StrictVersion("0.5.0"), + StrictVersion(ort_version) < StrictVersion("0.5.0"), reason="not available") @ignore_warnings(category=DeprecationWarning) def test_model_knn_regressor2_2_pipee(self): @@ -664,7 +666,7 @@ def test_model_knn_regressor2_2_pipee(self): basename="SklearnKNeighborsRegressorPipe2") @unittest.skipIf( - StrictVersion(onnxruntime.__version__) < StrictVersion("0.5.0"), + StrictVersion(ort_version) < StrictVersion("0.5.0"), reason="not available") @ignore_warnings(category=DeprecationWarning) def test_onnx_test_knn_transform(self): @@ -851,7 +853,7 @@ def test_sklearn_knn_imputer_cdist(self): @unittest.skipIf(not onnx_built_with_ml(), reason="Requires ONNX-ML extension.") @unittest.skipIf( - StrictVersion(onnxruntime.__version__) < StrictVersion("0.5.0"), + StrictVersion(ort_version) < StrictVersion("0.5.0"), reason="not available") @unittest.skipIf(TARGET_OPSET < 11, reason="needs higher target_opset") @@ -897,7 +899,7 @@ def test_model_knn_iris_regressor_multi_reg_radius(self): @unittest.skipIf(not onnx_built_with_ml(), reason="Requires ONNX-ML extension.") @unittest.skipIf( - StrictVersion(onnxruntime.__version__) < StrictVersion("0.5.0"), + StrictVersion(ort_version) < StrictVersion("0.5.0"), reason="not available") @unittest.skipIf(TARGET_OPSET < 11, reason="needs higher target_opset") @@ -941,7 +943,7 @@ def test_model_knn_iris_classifier_multi_reg2_weight_radius(self): @unittest.skipIf(not onnx_built_with_ml(), reason="Requires ONNX-ML extension.") @unittest.skipIf( - StrictVersion(onnxruntime.__version__) < StrictVersion("0.5.0"), + StrictVersion(ort_version) < StrictVersion("0.5.0"), reason="not available") @unittest.skipIf(TARGET_OPSET < 11, reason="needs higher target_opset") diff --git a/tests/test_sklearn_pipeline_concat_tfidf.py b/tests/test_sklearn_pipeline_concat_tfidf.py index 585238323..38b7f2d73 100644 --- a/tests/test_sklearn_pipeline_concat_tfidf.py +++ b/tests/test_sklearn_pipeline_concat_tfidf.py @@ -104,7 +104,7 @@ def get_pipeline(N=10000): textual_feature = 'TEXT' count_vect_transformer = Pipeline(steps=[ ('count_vect', CountVectorizer( - max_df=1.8, min_df=0.02, max_features=1000))]) + max_df=0.8, min_df=0.02, max_features=1000))]) preprocessor = ColumnTransformer( transformers=[ ('cat_transform', categorical_transformer, diff --git a/tests/test_sklearn_random_forest_converters.py b/tests/test_sklearn_random_forest_converters.py index c02f51340..7a9294c08 100644 --- a/tests/test_sklearn_random_forest_converters.py +++ b/tests/test_sklearn_random_forest_converters.py @@ -63,6 +63,9 @@ def _sklearn_version(): return StrictVersion(v) +ort_version = ".".join(ort_version.split('.')[:2]) + + class TestSklearnTreeEnsembleModels(unittest.TestCase): @unittest.skipIf(not onnx_built_with_ml(), reason="Requires ONNX-ML extension.") @@ -469,7 +472,7 @@ def test_boston_pca_rf(self): X_train, X_test, y_train, y_test = train_test_split( X, y, random_state=0) pipe = Pipeline([ - ('acp', PCA(n_components=7)), + ('acp', PCA(n_components=3)), ('rf', RandomForestRegressor())]) pipe.fit(X_train, y_train) X32 = X_test.astype(numpy.float32) diff --git a/tests/test_sklearn_stacking.py b/tests/test_sklearn_stacking.py index dd62d0156..f844d464a 100644 --- a/tests/test_sklearn_stacking.py +++ b/tests/test_sklearn_stacking.py @@ -49,15 +49,9 @@ def test_model_stacking_regression(self): target_opset=TARGET_OPSET) self.assertIsNotNone(model_onnx) dump_data_and_model( - X, - model, - model_onnx, + X, model, model_onnx, basename="SklearnStackingRegressor-Dec4", - allow_failure="StrictVersion(" - "onnxruntime.__version__)" - "<= StrictVersion('0.2.1')", - comparable_outputs=[0] - ) + comparable_outputs=[0]) @unittest.skipIf(StackingClassifier is None, reason="new in 0.22") @@ -70,15 +64,9 @@ def test_model_stacking_classifier(self): target_opset=TARGET_OPSET) self.assertIsNotNone(model_onnx) dump_data_and_model( - X, - model, - model_onnx, + X, model, model_onnx, basename="SklearnStackingClassifier", - allow_failure="StrictVersion(" - "onnxruntime.__version__)" - "<= StrictVersion('0.2.1')", - comparable_outputs=[0] - ) + comparable_outputs=[0]) @unittest.skipIf(StackingClassifier is None, reason="new in 0.22") @@ -94,9 +82,6 @@ def test_model_stacking_classifier_nozipmap(self): dump_data_and_model( X, model, model_onnx, basename="SklearnStackingClassifierNoZipMap", - allow_failure="StrictVersion(" - "onnxruntime.__version__)" - "<= StrictVersion('0.2.1')", comparable_outputs=[0]) diff --git a/tests/test_sklearn_voting_regressor_converter.py b/tests/test_sklearn_voting_regressor_converter.py index 3d93983ee..e4f6639ac 100644 --- a/tests/test_sklearn_voting_regressor_converter.py +++ b/tests/test_sklearn_voting_regressor_converter.py @@ -40,14 +40,9 @@ def test_model_voting_regression(self): self.assertIsNotNone(model_onnx) dump_data_and_model( X.astype(numpy.float32), - model, - model_onnx, + model, model_onnx, basename="SklearnVotingRegressor-Dec4", - allow_failure="StrictVersion(" - "onnxruntime.__version__)" - "<= StrictVersion('0.2.1')", - comparable_outputs=[0] - ) + comparable_outputs=[0]) @unittest.skipIf(VotingRegressor is None, reason="new in 0.21") def test_model_voting_regression_int(self): @@ -58,15 +53,9 @@ def test_model_voting_regression_int(self): target_opset=TARGET_OPSET) self.assertIsNotNone(model_onnx) dump_data_and_model( - X, - model, - model_onnx, + X, model, model_onnx, basename="SklearnVotingRegressorInt-Dec4", - allow_failure="StrictVersion(" - "onnxruntime.__version__)" - "<= StrictVersion('0.2.1')", - comparable_outputs=[0] - ) + comparable_outputs=[0]) @unittest.skipIf(VotingRegressor is None, reason="new in 0.21") def test_model_voting_regression_bool(self): @@ -77,15 +66,9 @@ def test_model_voting_regression_bool(self): target_opset=TARGET_OPSET) self.assertIsNotNone(model_onnx) dump_data_and_model( - X, - model, - model_onnx, + X, model, model_onnx, basename="SklearnVotingRegressorBool", - allow_failure="StrictVersion(" - "onnxruntime.__version__)" - "<= StrictVersion('0.2.1')", - comparable_outputs=[0] - ) + comparable_outputs=[0]) if __name__ == "__main__":