Typeerror: __array__() Takes 1 Positional Argument But 2 Were Given (image Classification Keras)
How to troubleshoot this? I've tried setting dtype=None in the image.img_to_array method. import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers i
Solution 1:
This error sometimes is due to a bug in Pillow 8.3.0
as it is here. (You may not use import PIL
directly in your code, however some libraries such as tf.keras.preprocessing.image.load_img
use PIL
internally)
So, downgrading from PIL 8.3.0
to 8.2.0
may work.
Check PIL
version:
import PIL
print(PIL.__version__)
If it is 8.3.0, then you may downgrade to 8.2.0:
!pip install pillow==8.2.0
Post a Comment for "Typeerror: __array__() Takes 1 Positional Argument But 2 Were Given (image Classification Keras)"