Hi, requesting some help for an issue encountered with a single spectrogram block with 3 input axis and got an error -1004 when building the cpp app and running it locally on a linux x86 box (it works when no spectrogram block and using raw data but accuracy is not good) - so looking for help on the forum I applied the workaround from here after reading this.
The problem I have now is that it appears that in the web interface the model training looks to have completed, however does not finish with a view of confusion matrix etc and I get this output:
Blockquote
15/15 - 0s - loss: 0.1152 - accuracy: 0.9600 - val_loss: 0.6274 - val_accuracy: 0.9076
Epoch 100/100
15/15 - 0s - loss: 0.0578 - accuracy: 0.9747 - val_loss: 0.6102 - val_accuracy: 0.9244
Finished training
Saving best performing model…
Converting TensorFlow Lite float32 model…
Converting TensorFlow Lite int8 quantized model with int8 input and output…
Calculating performance metrics…
Profiling float32 model…
/usr/local/lib/python3.6/dist-packages/sklearn/metrics/classification.py:1437: UndefinedMetricWarning: Precision and F-score are ill-defined and being set to 0.0 in labels with no predicted samples.
‘precision’, ‘predicted’, average, warn_for)
Unable to execute TensorFlow Lite float32 model:
Input to reshape is a tensor with 33 values, but the requested shape has 9801 [Op:Reshape]
Traceback (most recent call last):
File “./resources/libraries/ei_tensorflow/profiling.py”, line 435, in get_model_metadata
float32_perf = profile_tflite_model(model_type, model_float32, file_float32, validation_dataset, Y_test, X_samples, Y_samples, has_samples, memory, mode, prepare_model_tflite_script, prepare_model_tflite_eon_script, len(class_names), train_dataset, Y_train, test_dataset, Y_real_test)
File “./resources/libraries/ei_tensorflow/profiling.py”, line 152, in profile_tflite_model
feature_explorer_predictions = tflite_predict(model, X_samples, len(Y_samples))
File “./resources/libraries/ei_tensorflow/profiling.py”, line 39, in tflite_predict
item_as_tensor = tf.reshape(item_as_tensor, input_details[0][‘shape’])
File “/usr/local/lib/python3.6/dist-packages/tensorflow/python/util/dispatch.py”, line 201, in wrapper
return target(*args, **kwargs)
File “/usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/array_ops.py”, line 195, in reshape
result = gen_array_ops.reshape(tensor, shape, name)
File “/usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/gen_array_ops.py”, line 8368, in reshape
_ops.raise_from_not_ok_status(e, name)
File “/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/ops.py”, line 6862, in raise_from_not_ok_status
six.raise_from(core._status_to_exception(e.code, message), None)
File “”, line 3, in raise_from
tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 33 values, but the requested shape has 9801 [Op:Reshape]
Profiling int8 model…
/usr/local/lib/python3.6/dist-packages/sklearn/metrics/classification.py:1437: UndefinedMetricWarning: Precision and F-score are ill-defined and being set to 0.0 in labels with no predicted samples.
‘precision’, ‘predicted’, average, warn_for)
Unable to execute TensorFlow Lite int8 model:
Input to reshape is a tensor with 33 values, but the requested shape has 9801 [Op:Reshape]
Traceback (most recent call last):
File “./resources/libraries/ei_tensorflow/profiling.py”, line 466, in get_model_metadata
int8_perf = profile_tflite_model(model_type, model_int8, file_int8, validation_dataset, Y_test, X_samples, Y_samples, has_samples, memory, mode, prepare_model_tflite_script, prepare_model_tflite_eon_script, len(class_names), train_dataset, Y_train, test_dataset, Y_real_test)
File “./resources/libraries/ei_tensorflow/profiling.py”, line 152, in profile_tflite_model
feature_explorer_predictions = tflite_predict(model, X_samples, len(Y_samples))
File “./resources/libraries/ei_tensorflow/profiling.py”, line 39, in tflite_predict
item_as_tensor = tf.reshape(item_as_tensor, input_details[0][‘shape’])
File “/usr/local/lib/python3.6/dist-packages/tensorflow/python/util/dispatch.py”, line 201, in wrapper
return target(*args, **kwargs)
File “/usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/array_ops.py”, line 195, in reshape
result = gen_array_ops.reshape(tensor, shape, name)
File “/usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/gen_array_ops.py”, line 8368, in reshape
_ops.raise_from_not_ok_status(e, name)
File “/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/ops.py”, line 6862, in raise_from_not_ok_status
six.raise_from(core._status_to_exception(e.code, message), None)
File “”, line 3, in raise_from
tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 33 values, but the requested shape has 9801 [Op:Reshape]
Model training complete
Job completed
What am I doing wrong and how can I get correct output after the model training ?
Thanks