redouane-dziri / deep-music-classification

Classify music into genres using GLCM on mel-maps and CNNs
0 stars 0 forks source link

Predict for multi-input TF models #17

Closed arnaudstiegler closed 4 years ago

arnaudstiegler commented 4 years ago

Had a hard time predicting labels using the concatenated model which is a multi-input model. This issue is a way of keeping a record of how to do it

arnaudstiegler commented 4 years ago

The model has 4 different inputs. The basic approach using a tensor of 4 arrays was not working: test_ds = tf.data.Dataset.from_tensor_slices((x0,x1,x2,x3)).batch(32) model.predict(test_ds) was throwing a dimension error.

The fix was to provide a list of numpy arrays as the input: model.predict([x0,x1,x2,x3])