Hi,
I spend whole weekend trying to train simple 0-9 captcha solver, but I think I got stuck on the last step. I already passed test with high success, but final .tflite model does not work properly. Can you please help a little?
Steps to reproduce:
with output to terminal (I dont know if it is useful):
2023-09-11 18:07:01.736468: W tensorflow/compiler/mlir/lite/python/tf_tfl_flatbuffer_helpers.cc:362] Ignored output_format.
2023-09-11 18:07:01.736497: W tensorflow/compiler/mlir/lite/python/tf_tfl_flatbuffer_helpers.cc:365] Ignored drop_control_dependency.
2023-09-11 18:07:01.737129: I tensorflow/cc/saved_model/reader.cc:45] Reading SavedModel from: out/model
2023-09-11 18:07:01.753180: I tensorflow/cc/saved_model/reader.cc:89] Reading meta graph with tags { serve }
2023-09-11 18:07:01.753227: I tensorflow/cc/saved_model/reader.cc:130] Reading SavedModel debug info (if present) from: out/model
2023-09-11 18:07:01.785731: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:354] MLIR V1 optimization pass is not enabled
2023-09-11 18:07:01.796363: I tensorflow/cc/saved_model/loader.cc:229] Restoring SavedModel bundle.
2023-09-11 18:07:01.967260: I tensorflow/cc/saved_model/loader.cc:213] Running initialization op on SavedModel bundle at path: out/model
2023-09-11 18:07:02.019981: I tensorflow/cc/saved_model/loader.cc:305] SavedModel load for tags { serve }; Status: success: OK. Took 282855 microseconds.
2023-09-11 18:07:02.140917: I tensorflow/compiler/mlir/tensorflow/utils/dump_mlir_util.cc:268] disabling MLIR crash reproducer, set env var `MLIR_CRASH_REPRODUCER_DIRECTORY` to enable.
After this, model.tflite was created in out directory. I copied randomly a few images from data directory to base directory, renamed them test1.jpg - test5.jpg (which are: 0336, 3185, 7881, 8388, 9977) and then tried that .tflite model:
python bin/predict.py --model_path=out/model.tflite --available_chars="0123456789" --image_path=test1.png
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
Decoded label is the following:
1117
python bin/predict.py --model_path=out/model.tflite --available_chars="0123456789" --image_path=test2.png
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
Decoded label is the following:
1197
python bin/predict.py --model_path=out/model.tflite --available_chars="0123456789" --image_path=test3.png
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
Decoded label is the following:
1147
python bin/predict.py --model_path=out/model.tflite --available_chars="0123456789" --image_path=test4.png
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
Decoded label is the following:
1147
python bin/predict.py --model_path=out/model.tflite --available_chars="0123456789" --image_path=test5.png
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
Decoded label is the following:
1147
So this seems I do something wrong when I try to create .tflite file, can you please little help?
@jdvorak23 Sorry for the long response :-(. I found the bug: when using predict, image was loaded in a different way than when using test and train. I'll post a fix soon.
Hi, I spend whole weekend trying to train simple 0-9 captcha solver, but I think I got stuck on the last step. I already passed test with high success, but final .tflite model does not work properly. Can you please help a little? Steps to reproduce:
In this moment, I stopped script after a while, 7th epoch had val_all_correct_acc: 0.9453, so for testing purposes enough.
Then I ran test.py:
with result :
And .csv file with results, 92% succesfully as written. After that I have
model
folder inout
directory. I did:with output to terminal (I dont know if it is useful):
After this,
model.tflite
was created inout
directory. I copied randomly a few images fromdata
directory to base directory, renamed them test1.jpg - test5.jpg (which are: 0336, 3185, 7881, 8388, 9977) and then tried that.tflite
model:So this seems I do something wrong when I try to create
.tflite
file, can you please little help?