Coder Social home page Coder Social logo

Comments (14)

eragonruan avatar eragonruan commented on May 18, 2024 3

@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

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.

hurricanedjp avatar hurricanedjp commented on May 18, 2024 1

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.

cjt222 avatar cjt222 commented on May 18, 2024

@eragonruan

from text-detection-ctpn.

eragonruan avatar eragonruan commented on May 18, 2024

try add # -*- coding:utf-8 -*- in lib/networks/VGG_test.py

from text-detection-ctpn.

cjt222 avatar cjt222 commented on May 18, 2024

i try it ,maybe it can change nothing........... @eragonruan

from text-detection-ctpn.

eragonruan avatar eragonruan commented on May 18, 2024

@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.

cjt222 avatar cjt222 commented on May 18, 2024

thank you so much!!! it test well!!!

from text-detection-ctpn.

awilliamson avatar awilliamson commented on May 18, 2024

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.

awilliamson avatar awilliamson commented on May 18, 2024

@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.

arsalan993 avatar arsalan993 commented on May 18, 2024

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.

Tony1Q84 avatar Tony1Q84 commented on May 18, 2024

@cjt222 I also meet this problem, so how did you fix it, could you please tell me, thank you!

from text-detection-ctpn.

kiruthiga-A avatar kiruthiga-A commented on May 18, 2024

@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.

lkj1114889770 avatar lkj1114889770 commented on May 18, 2024

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.

jlidw avatar jlidw commented on May 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.