smallcorgi / Faster-RCNN_TF

Faster-RCNN in Tensorflow
MIT License
2.34k stars 1.12k forks source link

TypeError: 'module' object is not callable #290

Open zhejiazhang opened 6 years ago

zhejiazhang commented 6 years ago

Traceback (most recent call last): File "/home/marijuana/anaconda3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1361, in _do_call return fn(*args) File "/home/marijuana/anaconda3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1340, in _run_fn target_list, status, run_metadata) File "/home/marijuana/anaconda3/lib/python3.5/site-packages/tensorflow/python/framework/errors_impl.py", line 516, in exit c_api.TF_GetCode(self.status.status)) tensorflow.python.framework.errors_impl.InvalidArgumentError: TypeError: 'module' object is not callable [[Node: PyFunc = PyFunc[Tin=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_STRING, DT_INT32, DT_INT32], Tout=[DT_FLOAT], token="pyfunc_0", _device="/job:localhost/replica:0/task:0/device:CPU:0"](rpn_cls_prob_reshape/_95, rpn_bbox_pred/rpn_bbox_pred/_97, _arg_Placeholder_1_0_1, PyFunc/input_3, PyFunc/input_4, PyFunc/input_5)]] [[Node: PyFunc/_99 = _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_218_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 "/home/marijuana/DL/faster_rcnn/Faster-RCNN_TFpython3.5/tools/demo.py", line 126, in , _= im_detect(sess, net, im) File "/home/marijuana/DL/faster_rcnn/Faster-RCNN_TF_python3.5/tools/../lib/fast_rcnn/test.py", line 179, in im_detect run_metadata=run_metadata) File "/home/marijuana/anaconda3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 905, in run run_metadata_ptr) File "/home/marijuana/anaconda3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1137, in _run feed_dict_tensor, options, run_metadata) File "/home/marijuana/anaconda3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1355, in _do_run options, run_metadata) File "/home/marijuana/anaconda3/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1374, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.InvalidArgumentError: TypeError: 'module' object is not callable [[Node: PyFunc = PyFunc[Tin=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_STRING, DT_INT32, DT_INT32], Tout=[DT_FLOAT], token="pyfunc_0", _device="/job:localhost/replica:0/task:0/device:CPU:0"](rpn_cls_prob_reshape/_95, rpn_bbox_pred/rpn_bbox_pred/_97, _arg_Placeholder_1_0_1, PyFunc/input_3, PyFunc/input_4, PyFunc/input_5)]] [[Node: PyFunc/_99 = _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_218_PyFunc", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]()]]

Caused by op 'PyFunc', defined at: File "/home/marijuana/DL/faster_rcnn/Faster-RCNN_TF_python3.5/tools/demo.py", line 114, in net = get_network(args.demo_net) File "/home/marijuana/DL/faster_rcnn/Faster-RCNN_TF_python3.5/tools/../lib/networks/factory.py", line 28, in get_network return networks.VGGnet_test() File "/home/marijuana/DL/faster_rcnn/Faster-RCNN_TF_python3.5/tools/../lib/networks/VGGnet_test.py", line 16, in init self.setup() File "/home/marijuana/DL/faster_rcnn/Faster-RCNN_TF_python3.5/tools/../lib/networks/VGGnet_test.py", line 53, in setup .proposal_layer(_feat_stride, anchor_scales, 'TEST', name = 'rois')) File "/home/marijuana/DL/faster_rcnn/Faster-RCNN_TF_python3.5/tools/../lib/networks/network.py", line 25, in layer_decorated layer_output = op(self, layer_input, *args, **kwargs) File "/home/marijuana/DL/faster_rcnn/Faster-RCNN_TF_python3.5/tools/../lib/networks/network.py", line 162, in proposal_layer return tf.reshape(tf.py_func(proposal_layer_py,[input[0],input[1],input[2], cfg_key, _feat_stride, anchor_scales], [tf.float32]),[-1,5],name =name) File "/home/marijuana/anaconda3/lib/python3.5/site-packages/tensorflow/python/ops/script_ops.py", line 317, in py_func func=func, inp=inp, Tout=Tout, stateful=stateful, eager=False, name=name) File "/home/marijuana/anaconda3/lib/python3.5/site-packages/tensorflow/python/ops/script_ops.py", line 225, in _internal_py_func input=inp, token=token, Tout=Tout, name=name) File "/home/marijuana/anaconda3/lib/python3.5/site-packages/tensorflow/python/ops/gen_script_ops.py", line 93, in _py_func "PyFunc", input=input, token=token, Tout=Tout, name=name) File "/home/marijuana/anaconda3/lib/python3.5/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper op_def=op_def) File "/home/marijuana/anaconda3/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 3268, in create_op op_def=op_def) File "/home/marijuana/anaconda3/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 1650, in init self._traceback = self._graph._extract_stack() # pylint: disable=protected-access

InvalidArgumentError (see above for traceback): TypeError: 'module' object is not callable [[Node: PyFunc = PyFunc[Tin=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_STRING, DT_INT32, DT_INT32], Tout=[DT_FLOAT], token="pyfunc_0", _device="/job:localhost/replica:0/task:0/device:CPU:0"](rpn_cls_prob_reshape/_95, rpn_bbox_pred/rpn_bbox_pred/_97, _arg_Placeholder_1_0_1, PyFunc/input_3, PyFunc/input_4, PyFunc/input_5)]] [[Node: PyFunc/_99 = _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_218_PyFunc", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]()]]

already tried different import way, but just doesn't work, how can I solve this problem, thanks a lot

deeplearning666 commented 6 years ago

Hello! I have met the same question with you! Have you solved it? If you have solved the problem, can you tell me the method! I'm looking for forward to hearing from you soon! @zhejiazhang