diff --git a/ci/docker/install/requirements b/ci/docker/install/requirements index cbfc521e2c08..fd716f5fa815 100644 --- a/ci/docker/install/requirements +++ b/ci/docker/install/requirements @@ -26,8 +26,8 @@ h5py==2.8.0rc1 mock==2.0.0 nose==1.3.7 nose-timer==0.7.3 -numpy>1.16.0,<2.0.0 +numpy>1.16.0,<1.18.0 pylint==2.3.1; python_version >= '3.0' requests<2.19.0,>=2.18.4 -scipy==1.0.1 +scipy==1.2.1 six==1.11.0 diff --git a/tests/python/unittest/test_metric.py b/tests/python/unittest/test_metric.py index a1e5128d8ac6..e7273fba35d5 100644 --- a/tests/python/unittest/test_metric.py +++ b/tests/python/unittest/test_metric.py @@ -18,6 +18,7 @@ import mxnet as mx import numpy as np import scipy +from scipy.stats import pearsonr import json import math from common import with_seed @@ -267,7 +268,7 @@ def test_pearsonr(): pred1 = mx.nd.array([[0.3, 0.7], [0, 1.], [0.4, 0.6]]) label1 = mx.nd.array([[1, 0], [0, 1], [0, 1]]) pearsonr_expected_np = np.corrcoef(pred1.asnumpy().ravel(), label1.asnumpy().ravel())[0, 1] - pearsonr_expected_scipy, _ = scipy.stats.pearsonr(pred1.asnumpy().ravel(), label1.asnumpy().ravel()) + pearsonr_expected_scipy, _ = pearsonr(pred1.asnumpy().ravel(), label1.asnumpy().ravel()) macro_pr = mx.metric.create('pearsonr', average='macro') micro_pr = mx.metric.create('pearsonr', average='micro') @@ -289,7 +290,7 @@ def test_pearsonr(): label12 = mx.nd.array([[1, 0], [0, 1], [0, 1], [1, 0], [0, 1], [0, 1]]) pearsonr_expected_np = np.corrcoef(pred12.asnumpy().ravel(), label12.asnumpy().ravel())[0, 1] - pearsonr_expected_scipy, _ = scipy.stats.pearsonr(pred12.asnumpy().ravel(), label12.asnumpy().ravel()) + pearsonr_expected_scipy, _ = pearsonr(pred12.asnumpy().ravel(), label12.asnumpy().ravel()) macro_pr.reset() micro_pr.update([label2], [pred2]) diff --git a/tests/python/unittest/test_numpy_interoperability.py b/tests/python/unittest/test_numpy_interoperability.py index fcdf547bfbec..9b445044a3c1 100644 --- a/tests/python/unittest/test_numpy_interoperability.py +++ b/tests/python/unittest/test_numpy_interoperability.py @@ -758,7 +758,7 @@ def _add_workload_reshape(): # OpArgMngr.add_workload('reshape', b, (2, 2), order='F') # Items are not equal with order='F' a = np.array(_np.ones((0, 2))) - OpArgMngr.add_workload('reshape', a, -1, 2) + OpArgMngr.add_workload('reshape', a, (-1, 2)) def _add_workload_rint(array_pool):