CharlesShang / FastMaskRCNN

Mask RCNN in TensorFlow
Apache License 2.0
3.09k stars 1.1k forks source link

demo.py运行错误怎么解决呀 #183

Closed pbbpby231456 closed 6 years ago

pbbpby231456 commented 6 years ago

/mnt/anaconda/bin/python3.6 /mnt/chinese-ocr/demo.py /mnt/anaconda/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: compiletime version 3.5 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.6 return f(*args, *kwds) 2017-12-30 11:01:39.650441: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA 2017-12-30 11:01:39.759415: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:892] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2017-12-30 11:01:39.760667: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1030] Found device 0 with properties: name: GeForce 920MX major: 5 minor: 0 memoryClockRate(GHz): 0.993 pciBusID: 0000:01:00.0 totalMemory: 1.96GiB freeMemory: 1.59GiB 2017-12-30 11:01:39.760689: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1120] Creating TensorFlow device (/device:GPU:0) -> (device: 0, name: GeForce 920MX, pci bus id: 0000:01:00.0, compute capability: 5.0) ('data',) Tensor("Placeholder:0", shape=(?, ?, ?, 3), dtype=float32) (<tf.Tensor 'conv1_1/conv1_1:0' shape=(?, ?, ?, 64) dtype=float32>,) (<tf.Tensor 'conv1_2/conv1_2:0' shape=(?, ?, ?, 64) dtype=float32>,) (<tf.Tensor 'pool1:0' shape=(?, ?, ?, 64) dtype=float32>,) (<tf.Tensor 'conv2_1/conv2_1:0' shape=(?, ?, ?, 128) dtype=float32>,) (<tf.Tensor 'conv2_2/conv2_2:0' shape=(?, ?, ?, 128) dtype=float32>,) (<tf.Tensor 'pool2:0' shape=(?, ?, ?, 128) dtype=float32>,) (<tf.Tensor 'conv3_1/conv3_1:0' shape=(?, ?, ?, 256) dtype=float32>,) (<tf.Tensor 'conv3_2/conv3_2:0' shape=(?, ?, ?, 256) dtype=float32>,) (<tf.Tensor 'conv3_3/conv3_3:0' shape=(?, ?, ?, 256) dtype=float32>,) (<tf.Tensor 'pool3:0' shape=(?, ?, ?, 256) dtype=float32>,) (<tf.Tensor 'conv4_1/conv4_1:0' shape=(?, ?, ?, 512) dtype=float32>,) (<tf.Tensor 'conv4_2/conv4_2:0' shape=(?, ?, ?, 512) dtype=float32>,) (<tf.Tensor 'conv4_3/conv4_3:0' shape=(?, ?, ?, 512) dtype=float32>,) (<tf.Tensor 'pool4:0' shape=(?, ?, ?, 512) dtype=float32>,) (<tf.Tensor 'conv5_1/conv5_1:0' shape=(?, ?, ?, 512) dtype=float32>,) (<tf.Tensor 'conv5_2/conv5_2:0' shape=(?, ?, ?, 512) dtype=float32>,) (<tf.Tensor 'conv5_3/conv5_3:0' shape=(?, ?, ?, 512) dtype=float32>,) ('conv5_3',) Tensor("conv5_3/conv5_3:0", shape=(?, ?, ?, 512), dtype=float32) (<tf.Tensor 'rpn_conv/3x3/rpn_conv/3x3:0' shape=(?, ?, ?, 512) dtype=float32>,) ('rpn_conv/3x3',) Tensor("rpn_conv/3x3/rpn_conv/3x3:0", shape=(?, ?, ?, 512), dtype=float32) WARNING:tensorflow:<tensorflow.python.ops.rnn_cell_impl.BasicLSTMCell object at 0x7f00a0459080>: Using a concatenated state is slower and will soon be deprecated. Use state_is_tuple=True. (<tf.Tensor 'lstm_o/Reshape:0' shape=(?, ?, ?, 128) dtype=float32>,) ('lstm_o',) Tensor("lstm_o/Reshape:0", shape=(?, ?, ?, 128), dtype=float32) (<tf.Tensor 'rpn_bbox_pred/Reshape:0' shape=(?, ?, ?, 40) dtype=float32>,) ('lstm_o',) Tensor("lstm_o/Reshape:0", shape=(?, ?, ?, 128), dtype=float32) (<tf.Tensor 'rpn_cls_score/Reshape:0' shape=(?, ?, ?, 20) dtype=float32>,) ('rpn_cls_score',) Tensor("rpn_cls_score/Reshape:0", shape=(?, ?, ?, 20), dtype=float32) (<tf.Tensor 'Reshape_3:0' shape=(?, ?, ?, 2) dtype=float32>,) (<tf.Tensor 'rpn_cls_prob:0' shape=(?, ?, ?, ?) dtype=float32>,) ('rpn_cls_prob',) Tensor("rpn_cls_prob:0", shape=(?, ?, ?, ?), dtype=float32) (<tf.Tensor 'Reshape_5:0' shape=(?, ?, ?, 20) dtype=float32>,) ('rpn_cls_prob_reshape', 'rpn_bbox_pred', 'im_info') Tensor("Reshape_5:0", shape=(?, ?, ?, 20), dtype=float32) ('rpn_cls_prob_reshape', 'rpn_bbox_pred', 'im_info') Tensor("rpn_bbox_pred/Reshape:0", shape=(?, ?, ?, 40), dtype=float32) ('rpn_cls_prob_reshape', 'rpn_bbox_pred', 'im_info') Tensor("Placeholder_1:0", shape=(?, 3), dtype=float32) ((<tf.Tensor 'rois/Reshape:0' shape=(?, 5) dtype=float32>, <tf.Tensor 'rois/PyFunc:1' shape= dtype=float32>),) Using TensorFlow backend. 2017-12-30 11:01:42.207565: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1120] Creating TensorFlow device (/device:GPU:0) -> (device: 0, name: GeForce 920MX, pci bus id: 0000:01:00.0, compute capability: 5.0) /mnt/anaconda/lib/python3.6/site-packages/keras/models.py:252: UserWarning: No training configuration found in save file: the model was not compiled. Compile it manually. warnings.warn('No training configuration found in save file: ' 2017-12-30 11:01:43.539344: W tensorflow/core/common_runtime/bfc_allocator.cc:217] Allocator (GPU_0_bfc) ran out of memory trying to allocate 3.30GiB. The caller indicates that this is not a failure, but may mean that there could be performance gains if more memory is available. 2017-12-30 11:01:44.503693: W tensorflow/core/common_runtime/bfc_allocator.cc:217] Allocator (GPU_0_bfc) ran out of memory trying to allocate 2.38GiB. The caller indicates that this is not a failure, but may mean that there could be performance gains if more memory is available. 2017-12-30 11:01:44.953596: W tensorflow/core/common_runtime/bfc_allocator.cc:217] Allocator (GPU_0_bfc) ran out of memory trying to allocate 3.17GiB. The caller indicates that this is not a failure, but may mean that there could be performance gains if more memory is available. 2017-12-30 11:01:45.233261: W tensorflow/core/common_runtime/bfc_allocator.cc:217] Allocator (GPU_0_bfc) ran out of memory trying to allocate 1.19GiB. The caller indicates that this is not a failure, but may mean that there could be performance gains if more memory is available. 2017-12-30 11:01:45.644573: W tensorflow/core/common_runtime/bfc_allocator.cc:217] Allocator (GPU_0_bfc) ran out of memory trying to allocate 1.59GiB. The caller indicates that this is not a failure, but may mean that there could be performance gains if more memory is available. 2017-12-30 11:01:47.430090: W tensorflow/core/framework/op_kernel.cc:1192] Unknown: KeyError: b'TEST' Traceback (most recent call last): File "/mnt/anaconda/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1323, in _do_call return fn(args) File "/mnt/anaconda/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1302, in _run_fn status, run_metadata) File "/mnt/anaconda/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py", line 473, in exit c_api.TF_GetCode(self.status.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/device:CPU:0"](Reshape_5/_75, rpn_bbox_pred/Reshape/_77, _arg_Placeholder_1_0_1, rois/PyFunc/input_3, rois/PyFunc/input_4, rois/PyFunc/input_4)]] [[Node: rois/PyFunc/_79 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_270_rois/PyFunc", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]()]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/mnt/chinese-ocr/demo.py", line 17, in result, img = model.model(img, model='keras') File "/mnt/chinese-ocr/model.py", line 76, in model text_recs,tmp,img = text_detect(img) File "/mnt/chinese-ocr/ctpn/text_detect.py", line 8, in text_detect scores, boxes,img = ctpn(img) File "/mnt/chinese-ocr/ctpn/ctpn/model.py", line 33, in ctpn scores, boxes = test_ctpn(sess, net, img) File "/mnt/chinese-ocr/ctpn/lib/fast_rcnn/test.py", line 175, in test_ctpn rois = sess.run([net.get_output('rois')[0]], feed_dict=feed_dict) File "/mnt/anaconda/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 889, in run run_metadata_ptr) File "/mnt/anaconda/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1120, in _run feed_dict_tensor, options, run_metadata) File "/mnt/anaconda/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1317, in _do_run options, run_metadata) File "/mnt/anaconda/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1336, 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/device:CPU:0"](Reshape_5/_75, rpn_bbox_pred/Reshape/_77, _arg_Placeholder_1_0_1, rois/PyFunc/input_3, rois/PyFunc/input_4, rois/PyFunc/input_4)]] [[Node: rois/PyFunc/_79 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_270_rois/PyFunc", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]()]]

Caused by op 'rois/PyFunc', defined at: File "/mnt/chinese-ocr/demo.py", line 3, in import model File "", line 971, in _find_and_load File "", line 955, in _find_and_load_unlocked File "", line 665, in _load_unlocked File "", line 678, in exec_module File "", line 219, in _call_with_frames_removed File "/mnt/chinese-ocr/model.py", line 3, in from ctpn.text_detect import text_detect File "", line 971, in _find_and_load File "", line 955, in _find_and_load_unlocked File "", line 665, in _load_unlocked File "", line 678, in exec_module File "", line 219, in _call_with_frames_removed File "/mnt/chinese-ocr/ctpn/text_detect.py", line 3, in from ctpn.ctpn.model import ctpn File "", line 971, in _find_and_load File "", line 955, in _find_and_load_unlocked File "", line 665, in _load_unlocked File "", line 678, in exec_module File "", line 219, in _call_with_frames_removed File "/mnt/chinese-ocr/ctpn/ctpn/model.py", line 29, in sess,saver,net = load_tf_model() File "/mnt/chinese-ocr/ctpn/ctpn/model.py", line 22, in load_tf_model net = get_network("VGGnet_test") File "/mnt/chinese-ocr/ctpn/lib/networks/factory.py", line 20, in get_network return VGGnet_test() File "/mnt/chinese-ocr/ctpn/lib/networks/VGGnet_test.py", line 14, in init self.setup() File "/mnt/chinese-ocr/ctpn/lib/networks/VGGnet_test.py", line 62, in setup (self.feed('rpn_cls_prob_reshape', 'rpn_bbox_pred', 'im_info').proposal_layer(_feat_stride, anchor_scales, 'TEST', name='rois')) File "/mnt/chinese-ocr/ctpn/lib/networks/network.py", line 30, in layer_decorated layer_output = op(self, layer_input, *args, **kwargs) File "/mnt/chinese-ocr/ctpn/lib/networks/network.py", line 248, in proposal_layer blob, bbox_delta = tf.py_func(proposal_layer_py,[input[0], input[1], input[2], cfg_key, _feat_stride, anchor_scales], [tf.float32, tf.float32]) File "/mnt/anaconda/lib/python3.6/site-packages/tensorflow/python/ops/script_ops.py", line 212, in py_func input=inp, token=token, Tout=Tout, name=name) File "/mnt/anaconda/lib/python3.6/site-packages/tensorflow/python/ops/gen_script_ops.py", line 50, in _py_func "PyFunc", input=input, token=token, Tout=Tout, name=name) File "/mnt/anaconda/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper op_def=op_def) File "/mnt/anaconda/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2956, in create_op op_def=op_def) File "/mnt/anaconda/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1470, 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/device:CPU:0"](Reshape_5/_75, rpn_bbox_pred/Reshape/_77, _arg_Placeholder_1_0_1, rois/PyFunc/input_3, rois/PyFunc/input_4, rois/PyFunc/input_4)]] [[Node: rois/PyFunc/_79 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_270_rois/PyFunc", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]()]]

Process finished with exit code 1

frankzhuo commented 6 years ago

how to fix it ,master ?