smallcorgi / Faster-RCNN_TF

Faster-RCNN in Tensorflow

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tensorflow.python.framework.errors_impl.InvalidArgumentError: <exception str() failed>

wangyl218 opened this issue · comments

I trained the model in python3 on tf_1.13,I need to test the model in python2 on tf_1.4 ,when I run the /lib/fast_rcnn/test.py, then it happens the error:
Traceback (most recent call last):
File "demo.py", line 24, in
result, image_framed = ocr.model(image)
File "/data/wangyl/CTPN_FX_py2/ocr.py", line 84, in model
text_recs, img_framed,img1 = text_detect(img)
File "/data/wangyl/CTPN_FX_py2/ctpn/text_detect.py", line 101, in text_detect
scores, boxes, img1, scale = ctpn(img)
File "/data/wangyl/CTPN_FX_py2/ctpn/text_detect.py", line 59, in ctpn
scores, boxes, row = test_ctpn(sess, net, img1)
File "/data/wangyl/CTPN_FX_py2/ctpn/lib/fast_rcnn/test.py", line 72, in test_ctpn
rois = sess.run([net.get_output('rois')],feed_dict=feed_dict)
File "/home/tkocr/.conda/envs/py27_wyl/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 889, in run
run_metadata_ptr)
File "/home/tkocr/.conda/envs/py27_wyl/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1120, in _run
feed_dict_tensor, options, run_metadata)
File "/home/tkocr/.conda/envs/py27_wyl/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1317, in _do_run
options, run_metadata)
File "/home/tkocr/.conda/envs/py27_wyl/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1336, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: <exception str() failed>

I print the net.get_output('rois') and feed_dict both in py2 and p3, they are the same both in data and shape, but it runs OK in py3, occurs error in py2, Why, anyone help me please?