Comments (14)
@awilliamson First, I use 2to3 tool to convert the whole project from python2 to python3. This can fix bugs about print function and xrange/range and etc.Then fix some bug. like
-
lib/datasets/pascal_voc.py#L5 to fix pickle and cPickle
-
lib/networks/network.py#L43 decode format about loading the pretrain model
-
lib/rpn_msr/proposal_layer_tf.py#L46 decode format about the config key
just run the training script and fix bugs one by one, most of bug are caused by different encode and decode format.
from text-detection-ctpn.
I follow @eragonruan 's answer https://github.com/eragonruan/text-detection-ctpn/blob/3abf200be51fb577682681a85814aceb2460f804/lib/rpn_msr/proposal_layer_tf.py#L46 decode format about the config key ........ and fix it
from text-detection-ctpn.
from text-detection-ctpn.
try add # -*- coding:utf-8 -*-
in lib/networks/VGG_test.py
from text-detection-ctpn.
i try it ,maybe it can change nothing........... @eragonruan
from text-detection-ctpn.
@cjt222 python2/python3 compatblity have been done, you can check the latest code
the bug your met was caused by different decode format between python2 and python3.
from text-detection-ctpn.
thank you so much!!! it test well!!!
from text-detection-ctpn.
This may be useful information for those who are trying to convert smallcorgi/Faster-RCNN_TF from 2 to 3. @eragonruan Could you be more specific as to what the cause was, and how your proposed fix corrects this. I've looked at the latest networks/VGG_test, and only the config include is different from what I can see there's not utf-8 mention in there.
from text-detection-ctpn.
@eragonruan Thanks :) I found information regarding the cfg_key encoding fix from some other location. Hopefully your response will help others like me attempting to get the Faster-RCNN working, as this is the basis for your text detection.
Just to get to that stage to fix that, several tweaks to the build process under /lib had to be taken.
from text-detection-ctpn.
I am using python3.5 and tensorflow GPU. so its a GPU execution. OS is ubuntu 17.04 and its running successfully using using python 2 but not using python3.5
i am encountering this error
test@dc-isb-ds-001:~/Desktop/text-detection-ctpn$ python3 ./ctpn/demo.py
/usr/lib/python3/dist-packages/h5py/init.py:34: FutureWarning: Conversion of the second argument of issubdtype from float
to np.floating
is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type
.
from ._conv import register_converters as _register_converters
Traceback (most recent call last):
File "./ctpn/demo.py", line 8, in
from lib.networks.factory import get_network
File "/home/test/Desktop/text-detection-ctpn/lib/init.py", line 1, in
from . import fast_rcnn
File "/home/test/Desktop/text-detection-ctpn/lib/fast_rcnn/init.py", line 2, in
from . import train
File "/home/test/Desktop/text-detection-ctpn/lib/fast_rcnn/train.py", line 5, in
from ..roi_data_layer.layer import RoIDataLayer
File "/home/test/Desktop/text-detection-ctpn/lib/roi_data_layer/init.py", line 1, in
from . import roidb
File "/home/test/Desktop/text-detection-ctpn/lib/roi_data_layer/roidb.py", line 5, in
from lib.utils.bbox import bbox_overlaps
File "/home/test/Desktop/text-detection-ctpn/lib/utils/init.py", line 4, in
from . import bbox
ImportError: /home/test/Desktop/text-detection-ctpn/lib/utils/bbox.so: undefined symbol: _Py_ZeroStruct
from text-detection-ctpn.
@cjt222 I also meet this problem, so how did you fix it, could you please tell me, thank you!
from text-detection-ctpn.
@eragonruan, I have tried all the post you have provided earlier. But still am getting b'TEST error
I am using windows 10, python 3.6 and CPU. Most of the post here covers for GPU.
Could you please help me to solve the following issue?
Keyerror: b'TEST
2018-07-31 09:19:40.768405: W C:\tf_jenkins\home\workspace\rel-win\M\windows\PY\36\tensorflow\core\framework\op_kernel.cc:1192] Unknown: KeyError: b'TEST'
Traceback (most recent call last):
File "C:\Python 3.6\lib\site-packages\tensorflow\python\client\session.py", line 1327, in _do_call
return fn(*args)
File "C:\Python 3.6\lib\site-packages\tensorflow\python\client\session.py", line 1306, in _run_fn
status, run_metadata)
File "C:\Python 3.6\lib\contextlib.py", line 88, in exit
next(self.gen)
File "C:\Python 3.6\lib\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.UnknownError: KeyError: b'TEST'
[[Node: rois/PyFunc = PyFunc[Tin=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_STRING, DT_INT32, DT_INT32], Tout=[DT_FLOAT, DT_FLOAT], token="pyfunc_0", _device="/job:localhost/replica:0/task:0/cpu:0"](Reshape_2, rpn_bbox_pred/Reshape_1, _arg_Placeholder_1_0_1, rois/PyFunc/input_3, rois/PyFunc/input_4, rois/PyFunc/input_5)]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./ctpn/demo.py", line 106, in
_, _ = test_ctpn(sess, net, im)
File "D:\text-detection-ctpn-master\text-detection-ctpn-master\lib\fast_rcnn\test.py", line 51, in test_ctpn
rois = sess.run([net.get_output('rois')[0]],feed_dict=feed_dict)
File "C:\Python 3.6\lib\site-packages\tensorflow\python\client\session.py", line 895, in run
run_metadata_ptr)
File "C:\Python 3.6\lib\site-packages\tensorflow\python\client\session.py", line 1124, in _run
feed_dict_tensor, options, run_metadata)
File "C:\Python 3.6\lib\site-packages\tensorflow\python\client\session.py", line 1321, in _do_run
options, run_metadata)
File "C:\Python 3.6\lib\site-packages\tensorflow\python\client\session.py", line 1340, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.UnknownError: KeyError: b'TEST'
[[Node: rois/PyFunc = PyFunc[Tin=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_STRING, DT_INT32, DT_INT32], Tout=[DT_FLOAT, DT_FLOAT], token="pyfunc_0", _device="/job:localhost/replica:0/task:0/cpu:0"](Reshape_2, rpn_bbox_pred/Reshape_1, _arg_Placeholder_1_0_1, rois/PyFunc/input_3, rois/PyFunc/input_4, rois/PyFunc/input_5)]]
Caused by op 'rois/PyFunc', defined at:
File "./ctpn/demo.py", line 85, in
net = get_network("VGGnet_test")
File "D:\text-detection-ctpn-master\text-detection-ctpn-master\lib\networks\factory.py", line 8, in get_network
return VGGnet_test()
File "D:\text-detection-ctpn-master\text-detection-ctpn-master\lib\networks\VGGnet_test.py", line 14, in init
self.setup()
File "D:\text-detection-ctpn-master\text-detection-ctpn-master\lib\networks\VGGnet_test.py", line 55, in setup
.proposal_layer(_feat_stride, anchor_scales, 'TEST', name='rois'))
File "D:\text-detection-ctpn-master\text-detection-ctpn-master\lib\networks\network.py", line 21, in layer_decorated
layer_output = op(self, layer_input, *args, **kwargs)
File "D:\text-detection-ctpn-master\text-detection-ctpn-master\lib\networks\network.py", line 215, in proposal_layer
[tf.float32,tf.float32])
File "C:\Python 3.6\lib\site-packages\tensorflow\python\ops\script_ops.py", line 203, in py_func
input=inp, token=token, Tout=Tout, name=name)
File "C:\Python 3.6\lib\site-packages\tensorflow\python\ops\gen_script_ops.py", line 36, in _py_func
name=name)
File "C:\Python 3.6\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 767, in apply_op
op_def=op_def)
File "C:\Python 3.6\lib\site-packages\tensorflow\python\framework\ops.py", line 2630, in create_op
original_op=self._default_original_op, op_def=op_def)
File "C:\Python 3.6\lib\site-packages\tensorflow\python\framework\ops.py", line 1204, in init
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access
UnknownError (see above for traceback): KeyError: b'TEST'
[[Node: rois/PyFunc = PyFunc[Tin=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_STRING, DT_INT32, DT_INT32], Tout=[DT_FLOAT, DT_FLOAT], token="pyfunc_0", _device="/job:localhost/replica:0/task:0/cpu:0"](Reshape_2, rpn_bbox_pred/Reshape_1, _arg_Placeholder_1_0_1, rois/PyFunc/input_3, rois/PyFunc/input_4, rois/PyFunc/input_5)]]
from text-detection-ctpn.
I am using python3.5 and tensorflow GPU. I still get the same problem, KeyError: b'TEST', And i have try add # -- coding:utf-8 -- in lib/networks/VGG_test.py as methioned before, but i did not fixed the problem, could you tell me @eragonruan @cjt222 @Tony1Q84
from text-detection-ctpn.
I am using python3.6 and tensorflow GPU. I still get the same problem, KeyError: b'TEST'. And I have fixed it by decode format about the config key. However I am still confused about this problem. In python 3, all str are utf-8, why should I decode it as 'ascii' to solve this problem? I don't understand the reason of this error.
from text-detection-ctpn.
Related Issues (20)
- 百度网盘的权重链接失效了,有哪位大佬能提供下训练好的权重文件吗? HOT 4
- training with images from google
- demo.py中 将box转换为原始尺寸时,代码可能有一点小错误
- Crop detected region with result from .txt file but I got the wrong region? HOT 1
- loss值不下降,检测为0
- 请问有data 数据的百度云链接吗? 过期了 HOT 3
- It does not work with tensorflow 2.3.1
- bug in utils.py
- Resource Exhausted: OOM issue
- how to create our own training model? HOT 1
- when i train model My gpu utilization is nearly 0
- ImportError: cannot import name 'bbox' from partially initialized module 'lib.utils' (most likely due to a circular import) (/home/barry/Github/chinese_ocr/ctpn/lib/utils/__init__.py) HOT 3
- 如何预测anchor在X方向上的偏移?有人实现了么,当前模型检测出的文本行,两边会有多余的边缘,在识别的时候,多出的部分严重影响识别效果,
- 运行spilt_label.py结果一直显示Error processing HOT 1
- File "nms.pyx", line 28, in bbox.nms.nms ValueError: Buffer dtype mismatch, expected 'intp_t' but got 'long'
- there are some problem in check[oints HOT 1
- Model Quantization
- 请问怎样把检测出来的长文本进行字符切割?
- Required Python Version 2.7
- during multi-language model training, accuracy of English/numbers is worse than Chinese characters, how to improve?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from text-detection-ctpn.