[PYTHON] Input * of layer conv2d_ * is incompatible with the layer: expected axis -3 of input shape to have value * but received input with shape [None, *, *, *] error

About the error

Input * of layer conv2d_* is incompatible with the layer: expected axis -3 of input shape to have value * but received input with shape [None, *, *, *]

An error caused by the difference between NCHW and NHWC when using the conv layer. The value of "*" changes depending on the model setting.

Solution

https://keras.io/ja/backend/ Change keras.json directly under .keras to match the error as shown here.

The issue of batch, channel, height, and width order seems to be the first wall to hit.

Recommended Posts

Input * of layer conv2d_ * is incompatible with the layer: expected axis -3 of input shape to have value * but received input with shape [None, *, *, *] error