I am implementing LeNet-5 Model. I get the following error at random epochs and at random steps within an epoch. And sometimes it just works without any issues.
I tried to replace the input x_train and y_train with imageDataGenerator
Here is the link to the code where I'm facing the issue.
Epoch 1/200
1/10 [==>...........................] - ETA: 3s - loss: 0.1823 - accuracy: 0.9375
---------------------------------------------------------------------------
InvalidArgumentError Traceback (most recent call last)
<ipython-input-20-a90687551bd7> in <module>()
8 , epochs=number_of_epochs
9 , steps_per_epoch = 10
---> 10 , validation_data = datagen.flow(x_train, y_train, batch_size=batch_size, subset='validation')
11 )
6 frames
/usr/local/lib/python3.7/dist-packages/tensorflow/python/eager/execute.py in quick_execute(op_name, num_outputs, inputs, attrs, ctx, name)
58 ctx.ensure_initialized()
59 tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,
---> 60 inputs, attrs, num_outputs)
61 except core._NotOkStatusException as e:
62 if name is not None:
InvalidArgumentError: Incompatible shapes: [8,10] vs. [32,1]
[[node gradient_tape/categorical_crossentropy/softmax_cross_entropy_with_logits/mul (defined at <ipython-input-20-a90687551bd7>:10) ]] [Op:__inference_train_function_129979]
Function call stack:
train_function