1 | initial version |
@Maups, Thank you for the detailed question! This problem related to the data layout issue. By default, TensorFlow has NHWC (batch, height, width, channels) interpretation but OpenCV works with NCHW. So we need to map layers attributes to appropriate dimensions (i.e. concatenation by channels in TensorFlow defined with axis=3
and we map it to axis=1
internally). The fastest solution for your model is to use axis=-1
: flat_concat = tf.concat([flat_h_pool4_drop, flat_h_lconv3], -1)
as an alias to the last axis.
We're going to make TensorFlow importer more flexible for this kind of issues soon and your test case will be very helpful, many thanks!