Open bing1zhi2 opened 5 years ago
Detection took 6.520s for 24 object proposals Traceback (most recent call last): File "/home/chenhao/anaconda2/envs/dl35/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1327, in _do_call return fn(*args) File "/home/chenhao/anaconda2/envs/dl35/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1306, in _run_fn status, run_metadata) File "/home/chenhao/anaconda2/envs/dl35/lib/python3.5/contextlib.py", line 66, in exit next(self.gen) File "/home/chenhao/anaconda2/envs/dl35/lib/python3.5/site-packages/tensorflow/python/framework/errors_impl.py", line 466, in raise_exception_on_not_ok_status pywrap_tensorflow.TF_GetCode(status)) tensorflow.python.framework.errors_impl.FailedPreconditionError: Attempting to use uninitialized value conv2d_55/kernel [[Node: conv2d_55/kernel/read = IdentityT=DT_FLOAT, _class=["loc:@conv2d_55/kernel"], _device="/job:localhost/replica:0/task:0/cpu:0"]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/media/chenhao/study/code/other/chinese_ocr-master/demo.py", line 34, in
Caused by op 'conv2d_55/kernel/read', defined at:
File "/media/chenhao/study/code/other/chinese_ocr-master/demo.py", line 3, in
FailedPreconditionError (see above for traceback): Attempting to use uninitialized value conv2d_55/kernel [[Node: conv2d_55/kernel/read = IdentityT=DT_FLOAT, _class=["loc:@conv2d_55/kernel"], _device="/job:localhost/replica:0/task:0/cpu:0"]]
目前我把模型转化成tensorflow 模型,重写了demo.py 可以运行demo.py了,但上面的问题暂时还没解决。
现在看这个问题,估计是tensorflow 版本的问题,我用的 tf 1.6.
你好,我也遇到这个问题了,tf版本是1.8, 可以吧你重写的demo,py发给我吗,跑了三天,还是没通,十分感谢
@simplify23 先下载这个模型: 链接:https://pan.baidu.com/s/1gm0Uq_sLe00En-IbUPiQUg 提取码:qcco 复制这段内容后打开百度网盘手机App,操作更方便哦
然后可以参考这个代码使用: https://github.com/bing1zhi2/chinese_ocr/blob/master/chinese_ocr/predict_tf_tool.py 这个项目我还在更新,刚刚提交了一版
@simplify23 先下载这个模型: 链接:https://pan.baidu.com/s/1gm0Uq_sLe00En-IbUPiQUg 提取码:qcco 复制这段内容后打开百度网盘手机App,操作更方便哦
然后可以参考这个代码使用: https://github.com/bing1zhi2/chinese_ocr/blob/master/chinese_ocr/predict_tf_tool.py 这个项目我还在更新,刚刚提交了一版
感谢您的项目,看到您的项目参考了两个中文OCR项目。想问一下您具体是做什么的,您觉得yolo3+crnn和ctpn+densenet+ctc各有什么优势和缺点吗,非常感谢
@simplify23 我弄的那个项目是打算整合两个中文ocr项目的,看能不能更快更好。之前各自单独测试了下,现在在开发打算整合下。上面给你发的那个文件,它是使用cptn+densenet里的预训练模型用代码转化后的模型的,应该可以支持高版本tf, 单独测试过可以用的
@bing1zhi2 你好,这个项目里的demo.py只对给了检测代码,先检测再识别的代码没有,想问下大佬有吗?还有评估准确率,召回率的代码大佬有吗,是否可以发我一份,1971103492@qq.com,谢谢
安装环境后,运行测试时报错: Loading network VGGnet_test... Restoring from ./ctpn/checkpoints/VGGnet_fast_rcnn_iter_50000.ckpt... done Using TensorFlow backend. modelPath /home/kunqian/nvidia_dev/chinese_ocr-master/densenet/models/weights_densenet.h5 load_weights <keras.engine.training.Model object at 0x7fb9474597b8>
Detection took 3.500s for 24 object proposals Traceback (most recent call last): File "/root/anaconda3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1327, in _do_call return fn(*args) File "/root/anaconda3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1306, in _run_fn status, run_metadata) File "/root/anaconda3/lib/python3.5/contextlib.py", line 66, in exit next(self.gen) File "/root/anaconda3/lib/python3.5/site-packages/tensorflow/python/framework/errors_impl.py", line 466, in raise_exception_on_not_ok_status pywrap_tensorflow.TF_GetCode(status)) tensorflow.python.framework.errors_impl.FailedPreconditionError: Attempting to use uninitialized value batch_normalization_55/beta [[Node: batch_normalization_55/beta/read = IdentityT=DT_FLOAT, _class=["loc:@batch_normalization_55/beta"], _device="/job:localhost/replica:0/task:0/cpu:0"]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "demo.py", line 34, in
result, image_framed = ocr.model(image)
File "/home/kunqian/nvidia_dev/chinese_ocr-master/ocr.py", line 85, in model
result = charRec(img, text_recs, adjust)
File "/home/kunqian/nvidia_dev/chinese_ocr-master/ocr.py", line 69, in charRec
text = keras_densenet(image)
File "/home/kunqian/nvidia_dev/chinese_ocr-master/densenet/model.py", line 56, in predict
y_pred = basemodel.predict(X)
tensorflow.python.framework.errors_impl.FailedPreconditionError: Attempting to use uninitialized value batch_normalization_55/beta [[Node: batch_normalization_55/beta/read = IdentityT=DT_FLOAT, _class=["loc:@batch_normalization_55/beta"], _device="/job:localhost/replica:0/task:0/cpu:0"]]
我按setup 进行安装的环境