This is how I have my files now "artifact/char_to_num.json" and "artifact/num_to_char.json"
{"config": {"name": "string_lookup_1", "trainable": true, "dtype": "float32", "invert": true, "max_tokens": null, "num_oov_indices": 1, "oov_token": "[UNK]", "mask_token": null, "output_mode": "int", "sparse": false, "pad_to_max_tokens": false, "idf_weights": null, "vocabulary": ["[UNK]", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "M", "N", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "+", "-", "*", "!", "@", "."], "vocabulary_size": 38, "encoding": "utf-8"}, "weights": []}
D:\ocr_service\.venv\Scripts\python.exe D:\ocr_service\ocr_captcha\src\ocr_captcha\components\model_trainer.py
2024-05-07 09:25:38.677735: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2024-05-07 09:25:39.712543: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2024-05-07 09:25:41.673057: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
Traceback (most recent call last):
File "D:\ocr_service\ocr_captcha\src\ocr_captcha\components\model_trainer.py", line 82, in initate_model_training
model = build_model(self.img_width, self.img_height, char_to_num)
File "D:\ocr_service\ocr_captcha\src\ocr_captcha\utils\utils.py", line 178, in build_model
model = keras.models.Model(
AttributeError: 'function' object has no attribute 'Model'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\ocr_service\ocr_captcha\src\ocr_captcha\components\model_trainer.py", line 129, in <module>
model_path = trainer.initate_model_training(train_path_x, train_path_y, test_path_x, test_path_y, unique_chars)
File "D:\ocr_service\ocr_captcha\src\ocr_captcha\components\model_trainer.py", line 119, in initate_model_training
raise customexception(e, sys)
ocr_captcha.src.ocr_captcha.exception.exception.customexception: Error occured in python script |
name [D:\ocr_service\ocr_captcha\src\ocr_captcha\components\model_trainer.py]
line number [82]
error message ['function' object has no attribute 'Model']
Process finished with exit code 1