My stack: keras 1.2.2 + tensorflow on python 3.6; keras.json configured correctly to dim_ordering='tf'
The issue is, I get:
ValueError Traceback (most recent call last)
in ()
----> 1 dn.fit(x=mini_trn, y=y_trn, batch_size=32, validation_data=[mini_val, y_val])
/home/zwerg/anaconda3/lib/python3.6/site-packages/keras/engine/training.py in fit(self, x, y, batch_size, nb_epoch, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch)
1114 class_weight=class_weight,
1115 check_batch_axis=False,
-> 1116 batch_size=batch_size)
1117 # prepare validation data
1118 if validation_data:
/home/zwerg/anaconda3/lib/python3.6/site-packages/keras/engine/training.py in _standardize_user_data(self, x, y, sample_weight, class_weight, check_batch_axis, batch_size)
1031 output_shapes,
1032 check_batch_axis=False,
-> 1033 exception_prefix='model target')
1034 sample_weights = standardize_sample_weights(sample_weight,
1035 self.output_names)
/home/zwerg/anaconda3/lib/python3.6/site-packages/keras/engine/training.py in standardize_input_data(data, names, shapes, check_batch_axis, exception_prefix)
110 ' to have ' + str(len(shapes[i])) +
111 ' dimensions, but got array with shape ' +
--> 112 str(array.shape))
113 for j, (dim, ref_dim) in enumerate(zip(array.shape, shapes[i])):
114 if not j and not check_batch_axis:
ValueError: Error when checking model target: expected merge_384 to have 4 dimensions, but got array with shape (432, 8)
I created a dense net using
dn = DenseNetFCN(IMAGE_SIZE+(3,), classes=NUM_CLASSES, include_top=False, input_tensor=Input(IMAGE_SIZE+(3,)))
with IMAGE_SIZE = (224,224)
The image tensor shape is 432, 224, 224, 3
The merge layer 384 in question is configured like:
m384 = dn.get_layer('merge_384').get_config()
{'arguments': {},
'concat_axis': -1,
'dot_axes': -1,
'mode': 'concat',
'mode_type': 'raw',
'name': 'merge_384',
'output_mask': None,
'output_mask_type': 'raw',
'output_shape': None,
'output_shape_type': 'raw'}
Have you got any pointers as to why I might be getting this? I suspect some issue with the backend, but keras is configured correctly to tensorflow.