From 2c8850bccb92a4faa2eec309a4f83f9ee67bf33b Mon Sep 17 00:00:00 2001 From: Emeka boris ama Date: Fri, 2 Jul 2021 01:19:53 +0100 Subject: [PATCH] remove dtype from np.asarray The recent version of numpy automatically select a data type and accept one positional argument. The dtype return a dependencies error 'in asarray return array(a, dtype, copy=False, order=order) TypeError: __array__() takes 1 positional argument but 2 were given -->' --- keras_preprocessing/image/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keras_preprocessing/image/utils.py b/keras_preprocessing/image/utils.py index 91c55804..d0895992 100644 --- a/keras_preprocessing/image/utils.py +++ b/keras_preprocessing/image/utils.py @@ -284,7 +284,7 @@ def array_to_img(x, data_format='channels_last', scale=True, dtype='float32'): if pil_image is None: raise ImportError('Could not import PIL.Image. ' 'The use of `array_to_img` requires PIL.') - x = np.asarray(x, dtype=dtype) + x = np.asarray(x) if x.ndim != 3: raise ValueError('Expected image array to have rank 3 (single image). ' 'Got array with shape: %s' % (x.shape,))