Есть нейросеть
spoilerModel: "model_2"
__________________________________________________________________________________________________
Layer (type) Output Shape Param # Connected to
==================================================================================================
input_1 (InputLayer) [(None, 64, 64, 1)] 0 []
__________________________________________________________________________________________________
input_2 (InputLayer) [(None, 64, 64, 1)] 0 []
__________________________________________________________________________________________________
conv2d (Conv2D) (None, 64, 64, 32) 160 ['input_1[0][0]']
__________________________________________________________________________________________________
conv2d_3 (Conv2D) (None, 64, 64, 32) 160 ['input_2[0][0]']
__________________________________________________________________________________________________
max_pooling2d (MaxPooling2D) (None, 32, 32, 32) 0 ['conv2d[0][0]']
__________________________________________________________________________________________________
max_pooling2d_3 (MaxPooling2D) (None, 32, 32, 32) 0 ['conv2d_3[0][0]']
__________________________________________________________________________________________________
conv2d_1 (Conv2D) (None, 32, 32, 64) 8256 ['max_pooling2d[0][0]']
__________________________________________________________________________________________________
conv2d_4 (Conv2D) (None, 32, 32, 64) 8256 ['max_pooling2d_3[0][0]']
__________________________________________________________________________________________________
max_pooling2d_1 (MaxPooling2D) (None, 16, 16, 64) 0 ['conv2d_1[0][0]']
__________________________________________________________________________________________________
max_pooling2d_4 (MaxPooling2D) (None, 16, 16, 64) 0 ['conv2d_4[0][0]']
__________________________________________________________________________________________________
conv2d_2 (Conv2D) (None, 16, 16, 64) 16448 ['max_pooling2d_1[0][0]']
__________________________________________________________________________________________________
conv2d_5 (Conv2D) (None, 16, 16, 64) 16448 ['max_pooling2d_4[0][0]']
__________________________________________________________________________________________________
max_pooling2d_2 (MaxPooling2D) (None, 8, 8, 64) 0 ['conv2d_2[0][0]']
__________________________________________________________________________________________________
max_pooling2d_5 (MaxPooling2D) (None, 8, 8, 64) 0 ['conv2d_5[0][0]']
__________________________________________________________________________________________________
flatten (Flatten) (None, 4096) 0 ['max_pooling2d_2[0][0]']
__________________________________________________________________________________________________
flatten_1 (Flatten) (None, 4096) 0 ['max_pooling2d_5[0][0]']
__________________________________________________________________________________________________
dense (Dense) (None, 128) 524416 ['flatten[0][0]']
__________________________________________________________________________________________________
dense_1 (Dense) (None, 128) 524416 ['flatten_1[0][0]']
__________________________________________________________________________________________________
concatenate (Concatenate) (None, 256) 0 ['dense[0][0]',
'dense_1[0][0]']
__________________________________________________________________________________________________
dense_2 (Dense) (None, 256) 65792 ['concatenate[0][0]']
__________________________________________________________________________________________________
dense_3 (Dense) (None, 64) 16448 ['dense_2[0][0]']
__________________________________________________________________________________________________
dense_4 (Dense) (None, 3) 195 ['dense_3[0][0]']
__________________________________________________________________________________________________
dense_5 (Dense) (None, 3) 12 ['dense_4[0][0]']
==================================================================================================
Total params: 1,181,007
Trainable params: 1,181,007
Non-trainable params: 0
__________________________________________________________________________________________________
И ошибка которая возникает при подачи картики
spoilerWARNING:tensorflow:Model was constructed with shape (None, 64, 64, 1) for input KerasTensor(type_spec=TensorSpec(shape=(None, 64, 64, 1), dtype=tf.float32, name='input_1'), name='input_1', description="created by layer 'input_1'"), but it was called on an input with incompatible shape (32, 64).
WARNING:tensorflow:Model was constructed with shape (None, 64, 64, 1) for input KerasTensor(type_spec=TensorSpec(shape=(None, 64, 64, 1), dtype=tf.float32, name='input_2'), name='input_2', description="created by layer 'input_2'"), but it was called on an input with incompatible shape (32, 64).
Traceback (most recent call last):
print(model.predict([image,image2]))
ValueError: Exception encountered when calling layer "model_2" (type Functional).
Input 0 of layer "conv2d_3" is incompatible with the layer: expected min_ndim=4, found ndim=2. Full shape received: (32, 64)
Call arguments received:
• inputs=('tf.Tensor(shape=(32, 64), dtype=float32)', 'tf.Tensor(shape=(32, 64), dtype=float32)')
• training=False
• mask=None
Картинка
spoiler
print(image.shape)
print(len(image))
print(type(image))
print(image)
(64, 64)
64
class 'numpy.ndarray'
[[0. 0. 0. ... 0. 0. 0.]
[0. 0. 0. ... 0. 0. 0.]
[0. 0. 0. ... 0. 0. 0.]
...
[0. 0. 0. ... 0. 0. 0.]
[0. 0. 0. ... 0. 0. 0.]
[0. 0. 0. ... 0. 0. 0.]]
У изображения разрешение 64x64 что с ним нужно сделать чтобы подать его на нейросеть?