Skip to content

Instantly share code, notes, and snippets.

@gamename
Created March 21, 2024 22:20
Show Gist options
  • Save gamename/902232d7154f48e342f4643008ac8a31 to your computer and use it in GitHub Desktop.
Save gamename/902232d7154f48e342f4643008ac8a31 to your computer and use it in GitHub Desktop.
Meow train output
/Users/tennis/src/tflite-micro-fork/.venv/bin/python /Users/tennis/src/tflite-micro-fork/tensorflow/lite/micro/examples/micro_speech/train/meow_train.py
Training these words: meow
Training steps in each stage: 12000,3000
Learning rate in each stage: 0.001,0.0001
Total number of training steps: 15000
Training the model (this will take quite a while)...
2024-03-21 16:27:14.770321: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:388] MLIR V1 optimization pass is not enabled
WARNING:tensorflow:From /Users/tennis/src/tflite-micro-fork/.venv/lib/python3.11/site-packages/tensorflow/python/training/saver.py:1068: remove_checkpoint (from tensorflow.python.checkpoint.checkpoint_management) is deprecated and will be removed in a future version.
Instructions for updating:
Use standard file APIs to delete files with this prefix.
W0321 16:43:44.029635 8038076416 deprecation.py:50] From /Users/tennis/src/tflite-micro-fork/.venv/lib/python3.11/site-packages/tensorflow/python/training/saver.py:1068: remove_checkpoint (from tensorflow.python.checkpoint.checkpoint_management) is deprecated and will be removed in a future version.
Instructions for updating:
Use standard file APIs to delete files with this prefix.
WARNING:tensorflow:Confusion Matrix:
[[20 0 1]
[ 0 5 2]
[ 5 1 36]]
W0321 17:08:44.810421 8038076416 train.py:314] Confusion Matrix:
[[20 0 1]
[ 0 5 2]
[ 5 1 36]]
WARNING:tensorflow:Final test accuracy = 87.1% (N=70)
W0321 17:08:44.810511 8038076416 train.py:315] Final test accuracy = 87.1% (N=70)
Freezing the model
INFO:tensorflow:Restoring parameters from 2024-03-21_16-27-13/train/tiny_conv.ckpt-15000
I0321 17:08:46.773195 8038076416 saver.py:1417] Restoring parameters from 2024-03-21_16-27-13/train/tiny_conv.ckpt-15000
2024-03-21 17:08:46.773758: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:388] MLIR V1 optimization pass is not enabled
WARNING:tensorflow:From /Users/tennis/src/tflite-micro-fork/tensorflow/lite/micro/examples/micro_speech/tensorflow/tensorflow/examples/speech_commands/freeze.py:229: convert_variables_to_constants (from tensorflow.python.framework.convert_to_constants) is deprecated and will be removed in a future version.
Instructions for updating:
This API was designed for TensorFlow v1. See https://www.tensorflow.org/guide/migrate for instructions on how to migrate your code to TensorFlow v2.
W0321 17:08:46.776570 8038076416 deprecation.py:50] From /Users/tennis/src/tflite-micro-fork/tensorflow/lite/micro/examples/micro_speech/tensorflow/tensorflow/examples/speech_commands/freeze.py:229: convert_variables_to_constants (from tensorflow.python.framework.convert_to_constants) is deprecated and will be removed in a future version.
Instructions for updating:
This API was designed for TensorFlow v1. See https://www.tensorflow.org/guide/migrate for instructions on how to migrate your code to TensorFlow v2.
WARNING:tensorflow:From /Users/tennis/src/tflite-micro-fork/.venv/lib/python3.11/site-packages/tensorflow/python/framework/convert_to_constants.py:946: extract_sub_graph (from tensorflow.python.framework.graph_util_impl) is deprecated and will be removed in a future version.
Instructions for updating:
This API was designed for TensorFlow v1. See https://www.tensorflow.org/guide/migrate for instructions on how to migrate your code to TensorFlow v2.
W0321 17:08:46.776635 8038076416 deprecation.py:50] From /Users/tennis/src/tflite-micro-fork/.venv/lib/python3.11/site-packages/tensorflow/python/framework/convert_to_constants.py:946: extract_sub_graph (from tensorflow.python.framework.graph_util_impl) is deprecated and will be removed in a future version.
Instructions for updating:
This API was designed for TensorFlow v1. See https://www.tensorflow.org/guide/migrate for instructions on how to migrate your code to TensorFlow v2.
WARNING:tensorflow:From /Users/tennis/src/tflite-micro-fork/tensorflow/lite/micro/examples/micro_speech/tensorflow/tensorflow/examples/speech_commands/freeze.py:183: build_tensor_info (from tensorflow.python.saved_model.utils_impl) is deprecated and will be removed in a future version.
Instructions for updating:
This API was designed for TensorFlow v1. See https://www.tensorflow.org/guide/migrate for instructions on how to migrate your code to TensorFlow v2.
W0321 17:08:46.778215 8038076416 deprecation.py:50] From /Users/tennis/src/tflite-micro-fork/tensorflow/lite/micro/examples/micro_speech/tensorflow/tensorflow/examples/speech_commands/freeze.py:183: build_tensor_info (from tensorflow.python.saved_model.utils_impl) is deprecated and will be removed in a future version.
Instructions for updating:
This API was designed for TensorFlow v1. See https://www.tensorflow.org/guide/migrate for instructions on how to migrate your code to TensorFlow v2.
INFO:tensorflow:No assets to save.
I0321 17:08:46.778352 8038076416 builder_impl.py:679] No assets to save.
INFO:tensorflow:No assets to write.
I0321 17:08:46.778378 8038076416 builder_impl.py:497] No assets to write.
INFO:tensorflow:SavedModel written to: 2024-03-21_16-27-13/models/saved_model/saved_model.pb
I0321 17:08:46.786983 8038076416 builder_impl.py:461] SavedModel written to: 2024-03-21_16-27-13/models/saved_model/saved_model.pb
2024-03-21 17:08:47.001440: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:388] MLIR V1 optimization pass is not enabled
WARNING:absl:Invoking the TF1 implementation of TFLiteConverter because eager is disabled. Consider enabling eager.
WARNING:tensorflow:From /Users/tennis/src/tflite-micro-fork/.venv/lib/python3.11/site-packages/tensorflow/lite/python/convert_saved_model.py:42: load (from tensorflow.python.saved_model.loader_impl) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.saved_model.load` instead.
WARNING:tensorflow:From /Users/tennis/src/tflite-micro-fork/.venv/lib/python3.11/site-packages/tensorflow/lite/python/convert_saved_model.py:42: load (from tensorflow.python.saved_model.loader_impl) is deprecated and will be removed in a future version.
Instructions for updating:
Use `tf.saved_model.load` instead.
2024-03-21 17:08:47.074665: I tensorflow/core/grappler/devices.cc:75] Number of eligible GPUs (core count >= 8, compute capability >= 0.0): 0 (Note: TensorFlow was not compiled with CUDA or ROCm support)
2024-03-21 17:08:47.074716: I tensorflow/core/grappler/clusters/single_machine.cc:361] Starting new session
WARNING:tensorflow:From /Users/tennis/src/tflite-micro-fork/.venv/lib/python3.11/site-packages/tensorflow/lite/python/util.py:305: convert_variables_to_constants (from tensorflow.python.framework.convert_to_constants) is deprecated and will be removed in a future version.
Instructions for updating:
This API was designed for TensorFlow v1. See https://www.tensorflow.org/guide/migrate for instructions on how to migrate your code to TensorFlow v2.
WARNING:tensorflow:From /Users/tennis/src/tflite-micro-fork/.venv/lib/python3.11/site-packages/tensorflow/lite/python/util.py:305: convert_variables_to_constants (from tensorflow.python.framework.convert_to_constants) is deprecated and will be removed in a future version.
Instructions for updating:
This API was designed for TensorFlow v1. See https://www.tensorflow.org/guide/migrate for instructions on how to migrate your code to TensorFlow v2.
WARNING:tensorflow:From /Users/tennis/src/tflite-micro-fork/.venv/lib/python3.11/site-packages/tensorflow/python/framework/convert_to_constants.py:946: extract_sub_graph (from tensorflow.python.framework.graph_util_impl) is deprecated and will be removed in a future version.
Instructions for updating:
This API was designed for TensorFlow v1. See https://www.tensorflow.org/guide/migrate for instructions on how to migrate your code to TensorFlow v2.
WARNING:tensorflow:From /Users/tennis/src/tflite-micro-fork/.venv/lib/python3.11/site-packages/tensorflow/python/framework/convert_to_constants.py:946: extract_sub_graph (from tensorflow.python.framework.graph_util_impl) is deprecated and will be removed in a future version.
Instructions for updating:
This API was designed for TensorFlow v1. See https://www.tensorflow.org/guide/migrate for instructions on how to migrate your code to TensorFlow v2.
2024-03-21 17:08:47.099276: I tensorflow/core/grappler/devices.cc:75] Number of eligible GPUs (core count >= 8, compute capability >= 0.0): 0 (Note: TensorFlow was not compiled with CUDA or ROCm support)
2024-03-21 17:08:47.099340: I tensorflow/core/grappler/clusters/single_machine.cc:361] Starting new session
2024-03-21 17:08:47.105532: I tensorflow/core/grappler/devices.cc:75] Number of eligible GPUs (core count >= 8, compute capability >= 0.0): 0 (Note: TensorFlow was not compiled with CUDA or ROCm support)
2024-03-21 17:08:47.105579: I tensorflow/core/grappler/clusters/single_machine.cc:361] Starting new session
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
W0000 00:00:1711058927.107879 169120350 tf_tfl_flatbuffer_helpers.cc:390] Ignored output_format.
W0000 00:00:1711058927.107892 169120350 tf_tfl_flatbuffer_helpers.cc:393] Ignored drop_control_dependency.
2024-03-21 17:08:47.119543: I tensorflow/compiler/mlir/lite/flatbuffer_export.cc:3064] Estimated count of arithmetic ops: 0.668 M ops, equivalently 0.334 M MACs
WARNING:absl:Invoking the TF1 implementation of TFLiteConverter because eager is disabled. Consider enabling eager.
Float model is 52360 bytes
2024-03-21 17:08:47.142390: I tensorflow/core/grappler/devices.cc:75] Number of eligible GPUs (core count >= 8, compute capability >= 0.0): 0 (Note: TensorFlow was not compiled with CUDA or ROCm support)
2024-03-21 17:08:47.142448: I tensorflow/core/grappler/clusters/single_machine.cc:361] Starting new session
2024-03-21 17:08:47.166117: I tensorflow/core/grappler/devices.cc:75] Number of eligible GPUs (core count >= 8, compute capability >= 0.0): 0 (Note: TensorFlow was not compiled with CUDA or ROCm support)
2024-03-21 17:08:47.166157: I tensorflow/core/grappler/clusters/single_machine.cc:361] Starting new session
2024-03-21 17:08:47.172493: I tensorflow/core/grappler/devices.cc:75] Number of eligible GPUs (core count >= 8, compute capability >= 0.0): 0 (Note: TensorFlow was not compiled with CUDA or ROCm support)
2024-03-21 17:08:47.172542: I tensorflow/core/grappler/clusters/single_machine.cc:361] Starting new session
W0000 00:00:1711058927.174467 169120350 tf_tfl_flatbuffer_helpers.cc:390] Ignored output_format.
W0000 00:00:1711058927.174478 169120350 tf_tfl_flatbuffer_helpers.cc:393] Ignored drop_control_dependency.
2024-03-21 17:08:47.182018: I tensorflow/compiler/mlir/lite/flatbuffer_export.cc:3064] Estimated count of arithmetic ops: 0.668 M ops, equivalently 0.334 M MACs
fully_quantize: 0, inference_type: 6, input_inference_type: INT8, output_inference_type: INT8
2024-03-21 17:08:47.420773: I tensorflow/compiler/mlir/lite/flatbuffer_export.cc:3064] Estimated count of arithmetic ops: 0.668 M ops, equivalently 0.334 M MACs
Quantized model is 15056 bytes
Quantized model Precision: 0.900, Recall: 0.900, F1 Score: 0.900 (Number of test samples=70)
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
Traceback (most recent call last):
File "/Users/tennis/src/tflite-micro-fork/tensorflow/lite/micro/examples/micro_speech/train/meow_train.py", line 358, in <module>
main()
File "/Users/tennis/src/tflite-micro-fork/tensorflow/lite/micro/examples/micro_speech/train/meow_train.py", line 314, in main
predictions, true_labels = get_model_predictions_and_labels(MODEL_TFLITE, test_data, test_labels)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/tennis/src/tflite-micro-fork/tensorflow/lite/micro/examples/micro_speech/train/meow_train.py", line 111, in get_model_predictions_and_labels
interpreter.set_tensor(input_details['index'], test_data[i:i + 1])
File "/Users/tennis/src/tflite-micro-fork/.venv/lib/python3.11/site-packages/tensorflow/lite/python/interpreter.py", line 720, in set_tensor
self._interpreter.SetTensor(tensor_index, value)
ValueError: Cannot set tensor: Dimension mismatch. Got 3 but expected 1960 for dimension 1 of input 0.
Process finished with exit code 1
@gamename
Copy link
Author

Here is the F1 Score

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment