MaybeShewill-CV / CRNN_Tensorflow

Convolutional Recurrent Neural Networks(CRNN) for Scene Text Recognition
MIT License
1.03k stars 388 forks source link

Error calling crnn_model #371

Closed SimonWang00 closed 4 years ago

SimonWang00 commented 5 years ago

When I call the crnn_model, the following error occurs. Is there any way to solve it, thank you! My TF version is 1.12.0

DataLossError (see above for traceback): Unable to open table file ./crnn_chinese: Failed precondition: crnn_chinese; 是一个目录: perhaps your file is in a different file format and you need to use a different restore operator? [[node save/RestoreV2 (defined at tools/test_shadownet.py:120) = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]

SimonWang00 commented 5 years ago

I have also tried different ways to restore TF model, and errors will be reported. I downloaded the model from Dropbox.

MaybeShewill-CV commented 5 years ago

@SimonWang00 Paste the command you use here:)

SimonWang00 commented 5 years ago

@SimonWang00 Paste the command you use here:) I train with the following instructions:

python3.6 tools/test_shadownet.py --image_path /home/test/deeplearn/CRNN_Tensorflow/data/test_images/test_01.jpg --weights_path crnn_chinese --char_dict_path /home/test/deeplearn/CRNN_Tensorflow/data/char_dict/char_dict_cn.json --ord_map_dict_path /home/test/deeplearn/CRNN_Tensorflow/data/char_dict/ord_map_cn.json

MaybeShewill-CV commented 5 years ago

@SimonWang00 wrong weights_path:)

SimonWang00 commented 5 years ago

@SimonWang00 wrong weights_path:)

I still report an error using the absolute path. The error log is the same.

command: --weights_path /home/test/deeplearn/CRNN_Tensorflow/crnn_chinese

Error log: DataLossError (see above for traceback): Unable to open table file /home/test/deeplearn/CRNN_Tensorflow/crnn_chinese: Failed precondition: /home/test/deeplearn/CRNN_Tensorflow/crnn_chinese; 是一个目录: perhaps your file is in a different file format and you need to use a different restore operator? [[node save/RestoreV2 (defined at tools/test_shadownet.py:120) = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]

MaybeShewill-CV commented 5 years ago

@SimonWang00 You may google how to use tensorflow ckpt weights file:)