gasparian / CRNN-OCR-lite

Lightweight CRNN for OCR (including handwritten text) with depthwise separable convolutions and spatial transformer module [keras+tf]
148 stars 30 forks source link

getting error while using own trained model. #8

Open SinghiDivyanshu opened 4 years ago

SinghiDivyanshu commented 4 years ago

getting error while running predict.py on our own trained model. used same version of python while training and predicting but getting unknown op code error. Thanks in Advance.

XXX lineno: 99, opcode: 47 Traceback (most recent call last): File "predict.py", line 115, in <module> model = load_custom_model(model_path, model_name='model.json', weights="final_weights.h5") File "C:\DivyanshuWorkspace\Code\PoA_switzerland\github\CRNN-OCR-lite-master\CRNN-OCR-lite-master\utils.py", line 327, in load_custom_model model = model_from_json(loaded_model_json, custom_objects={'BilinearInterpolation': BilinearInterpolation}) File "C:\Users\Divyanshu.Singhi\Anaconda3\lib\site-packages\tensorflow\python\keras\saving\model_config.py", line 122, in model_from_json return deserialize(config, custom_objects=custom_objects) File "C:\Users\Divyanshu.Singhi\Anaconda3\lib\site-packages\tensorflow\python\keras\layers\serialization.py", line 175, in deserialize printable_module_name='layer') File "C:\Users\Divyanshu.Singhi\Anaconda3\lib\site-packages\tensorflow\python\keras\utils\generic_utils.py", line 358, in deserialize_keras_object list(custom_objects.items()))) File "C:\Users\Divyanshu.Singhi\Anaconda3\lib\site-packages\tensorflow\python\keras\engine\functional.py", line 617, in from_config config, custom_objects) File "C:\Users\Divyanshu.Singhi\Anaconda3\lib\site-packages\tensorflow\python\keras\engine\functional.py", line 1214, in reconstruct_from_config process_node(layer, node_data) File "C:\Users\Divyanshu.Singhi\Anaconda3\lib\site-packages\tensorflow\python\keras\engine\functional.py", line 1162, in process_node output_tensors = layer(input_tensors, **kwargs) File "C:\Users\Divyanshu.Singhi\Anaconda3\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 926, in __call__ input_list) File "C:\Users\Divyanshu.Singhi\Anaconda3\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 1117, in _functional_construction_call outputs = call_fn(cast_inputs, *args, **kwargs) File "C:\Users\Divyanshu.Singhi\Anaconda3\lib\site-packages\tensorflow\python\keras\layers\core.py", line 903, in call result = self.function(inputs, **kwargs) File "C:/DivyanshuWorkspace/Code/PoA_switzerland/github/CRNN-OCR-lite-master/CRNN-OCR-lite-master/utils.py", line 99, in ctc_lambda_func y_pred, labels, input_length, label_length = args SystemError: unknown opcode