tensorflow.python.framework.errors_impl.InvalidArgumentError:pyfunc_1返回3个值,但希望看到1个值

时间:2018-11-01 12:39:03

标签: api tensorflow

我遇到了问题,谢谢。

Traceback (most recent call last):
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\client\session.py", line 1292, in _do_call
        return fn(*args)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\client\session.py", line 1277, in _run_fn
        options, feed_dict, fetch_list, target_list, run_metadata)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\client\session.py", line 1367, in _call_tf_sessionrun
        run_metadata)
    tensorflow.python.framework.errors_impl.InvalidArgumentError: pyfunc_1 returns 3 values, but expects to see 1 values.
             [[{{node map_1/while/PyFunc}} = PyFunc[Tin=[DT_UINT8, DT_FLOAT, DT_INT64, DT_FLOAT], Tout=[DT_UINT8], _class=["loc:@map_1/while/TensorArrayWrite/TensorArrayWriteV3"], token="pyfunc_1", _device="/job:localhost/replica:0/task:0/device:CPU:0"](map_1/while/TensorArrayReadV3, map_1/while/TensorArrayReadV3_1/_2287, map_1/while/TensorArrayReadV3_2, map_1/while/TensorArrayReadV3_3/_2289)]]
             [[{{node map/while/TensorArrayWrite/TensorArrayWriteV3/_2359}} = _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_1747_map/while/TensorArrayWrite/TensorArrayWriteV3", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"](^_cloopmap/while/NextIteration_2/_2188)]]

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "models\research\object_detection\model_main.py", line 103, in <module>
        tf.app.run()
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\platform\app.py", line 125, in run
        _sys.exit(main(argv))
      File "models\research\object_detection\model_main.py", line 99, in main
        tf.estimator.train_and_evaluate(estimator, train_spec, eval_specs[0])
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\estimator\training.py", line 471, in train_and_evaluate
        return executor.run()
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\estimator\training.py", line 610, in run
        return self.run_local()
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\estimator\training.py", line 711, in run_local
        saving_listeners=saving_listeners)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\estimator\estimator.py", line 356, in train
        loss = self._train_model(input_fn, hooks, saving_listeners)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\estimator\estimator.py", line 1181, in _train_model
        return self._train_model_default(input_fn, hooks, saving_listeners)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\estimator\estimator.py", line 1215, in _train_model_default
        saving_listeners)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\estimator\estimator.py", line 1409, in _train_with_estimator_spec
        _, loss = mon_sess.run([estimator_spec.train_op, estimator_spec.loss])
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\training\monitored_session.py", line 671, in run
        run_metadata=run_metadata)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\training\monitored_session.py", line 1148, in run
        run_metadata=run_metadata)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\training\monitored_session.py", line 1239, in run
        raise six.reraise(*original_exc_info)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\six.py", line 693, in reraise
        raise value
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\training\monitored_session.py", line 1224, in run
        return self._sess.run(*args, **kwargs)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\training\monitored_session.py", line 1304, in run
        run_metadata=run_metadata))
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\training\basic_session_run_hooks.py", line 581, in after_run
        if self._save(run_context.session, global_step):
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\training\basic_session_run_hooks.py", line 606, in _save
        if l.after_save(session, step):
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\estimator\training.py", line 517, in after_save
        self._evaluate(global_step_value)  # updates self.eval_result
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\estimator\training.py", line 537, in _evaluate
        self._evaluator.evaluate_and_export())
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\estimator\training.py", line 912, in evaluate_and_export
        hooks=self._eval_spec.hooks)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\estimator\estimator.py", line 476, in evaluate
        return _evaluate()
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\estimator\estimator.py", line 469, in _evaluate
        output_dir=self.eval_dir(name))
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\estimator\estimator.py", line 1528, in _evaluate_run
        config=self._session_config)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\training\evaluation.py", line 212, in _evaluate_once
        session.run(eval_ops, feed_dict)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\training\monitored_session.py", line 783, in __exit__
        self._close_internal(exception_type)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\training\monitored_session.py", line 816, in _close_internal
        h.end(self._coordinated_creator.tf_sess)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\training\basic_session_run_hooks.py", line 941, in end
        self._final_ops, feed_dict=self._final_ops_feed_dict)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\client\session.py", line 887, in run
        run_metadata_ptr)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\client\session.py", line 1110, in _run
        feed_dict_tensor, options, run_metadata)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\client\session.py", line 1286, in _do_run
        run_metadata)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\client\session.py", line 1308, in _do_call
        raise type(e)(node_def, op, message)
    tensorflow.python.framework.errors_impl.InvalidArgumentError: pyfunc_1 returns 3 values, but expects to see 1 values.
             [[{{node map_1/while/PyFunc}} = PyFunc[Tin=[DT_UINT8, DT_FLOAT, DT_INT64, DT_FLOAT], Tout=[DT_UINT8], _class=["loc:@map_1/while/TensorArrayWrite/TensorArrayWriteV3"], token="pyfunc_1", _device="/job:localhost/replica:0/task:0/device:CPU:0"](map_1/while/TensorArrayReadV3, map_1/while/TensorArrayReadV3_1/_2287, map_1/while/TensorArrayReadV3_2, map_1/while/TensorArrayReadV3_3/_2289)]]
             [[{{node map/while/TensorArrayWrite/TensorArrayWriteV3/_2359}} = _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_1747_map/while/TensorArrayWrite/TensorArrayWriteV3", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"](^_cloopmap/while/NextIteration_2/_2188)]]

    Caused by op 'map_1/while/PyFunc', defined at:
      File "models\research\object_detection\model_main.py", line 103, in <module>
        tf.app.run()
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\platform\app.py", line 125, in run
        _sys.exit(main(argv))
      File "models\research\object_detection\model_main.py", line 99, in main
        tf.estimator.train_and_evaluate(estimator, train_spec, eval_specs[0])
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\estimator\training.py", line 471, in train_and_evaluate
        return executor.run()
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\estimator\training.py", line 610, in run
        return self.run_local()
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\estimator\training.py", line 711, in run_local
        saving_listeners=saving_listeners)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\estimator\estimator.py", line 356, in train
        loss = self._train_model(input_fn, hooks, saving_listeners)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\estimator\estimator.py", line 1181, in _train_model
        return self._train_model_default(input_fn, hooks, saving_listeners)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\estimator\estimator.py", line 1215, in _train_model_default
        saving_listeners)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\estimator\estimator.py", line 1409, in _train_with_estimator_spec
        _, loss = mon_sess.run([estimator_spec.train_op, estimator_spec.loss])
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\training\monitored_session.py", line 671, in run
        run_metadata=run_metadata)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\training\monitored_session.py", line 1148, in run
        run_metadata=run_metadata)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\training\monitored_session.py", line 1224, in run
        return self._sess.run(*args, **kwargs)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\training\monitored_session.py", line 1304, in run
        run_metadata=run_metadata))
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\training\basic_session_run_hooks.py", line 581, in after_run
        if self._save(run_context.session, global_step):
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\training\basic_session_run_hooks.py", line 606, in _save
        if l.after_save(session, step):
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\estimator\training.py", line 517, in after_save
        self._evaluate(global_step_value)  # updates self.eval_result
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\estimator\training.py", line 537, in _evaluate
        self._evaluator.evaluate_and_export())
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\estimator\training.py", line 912, in evaluate_and_export
        hooks=self._eval_spec.hooks)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\estimator\estimator.py", line 476, in evaluate
        return _evaluate()
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\estimator\estimator.py", line 462, in _evaluate
        self._evaluate_build_graph(input_fn, hooks, checkpoint_path))
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\estimator\estimator.py", line 1422, in _evaluate_build_graph
        self._call_model_fn_eval(input_fn, self.config))
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\estimator\estimator.py", line 1458, in _call_model_fn_eval
        features, labels, model_fn_lib.ModeKeys.EVAL, config)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\estimator\estimator.py", line 1169, in _call_model_fn
        model_fn_results = self._model_fn(features=features, **kwargs)
      File "F:\tensorflow\models\research\object_detection\model_lib.py", line 371, in model_fn
        use_normalized_coordinates=False))
      File "F:\tensorflow\models\research\object_detection\utils\visualization_utils.py", line 455, in draw_side_by_side_evaluation_image
        use_normalized_coordinates=use_normalized_coordinates)
      File "F:\tensorflow\models\research\object_detection\utils\visualization_utils.py", line 385, in draw_bounding_boxes_on_image_tensors
        images = tf.map_fn(draw_boxes, elems, dtype=tf.uint8, back_prop=False)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\ops\functional_ops.py", line 460, in map_fn
        maximum_iterations=n)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\ops\control_flow_ops.py", line 3274, in while_loop
        return_same_structure)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\ops\control_flow_ops.py", line 2994, in BuildLoop
        pred, body, original_loop_vars, loop_vars, shape_invariants)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\ops\control_flow_ops.py", line 2929, in _BuildLoop
        body_result = body(*packed_vars_for_body)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\ops\control_flow_ops.py", line 3243, in <lambda>
        body = lambda i, lv: (i + 1, orig_body(*lv))
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\ops\functional_ops.py", line 449, in compute
        packed_fn_values = fn(packed_values)
      File "F:\tensorflow\models\research\object_detection\utils\visualization_utils.py", line 382, in draw_boxes
        tf.uint8)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\ops\script_ops.py", line 457, in py_func
        func=func, inp=inp, Tout=Tout, stateful=stateful, eager=False, name=name)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\ops\script_ops.py", line 281, in _internal_py_func
        input=inp, token=token, Tout=Tout, name=name)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\ops\gen_script_ops.py", line 132, in py_func
        "PyFunc", input=input, token=token, Tout=Tout, name=name)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 787, in _apply_op_helper
        op_def=op_def)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\util\deprecation.py", line 488, in new_func
        return func(*args, **kwargs)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\framework\ops.py", line 3272, in create_op
        op_def=op_def)
      File "e:\Program Files\Anaconda3\envs\shengheng\lib\site-packages\tensorflow\python\framework\ops.py", line 1768, in __init__
        self._traceback = tf_stack.extract_stack()

    InvalidArgumentError (see above for traceback): pyfunc_1 returns 3 values, but expects to see 1 values.
             [[{{node map_1/while/PyFunc}} = PyFunc[Tin=[DT_UINT8, DT_FLOAT, DT_INT64, DT_FLOAT], Tout=[DT_UINT8], _class=["loc:@map_1/while/TensorArrayWrite/TensorArrayWriteV3"], token="pyfunc_1", _device="/job:localhost/replica:0/task:0/device:CPU:0"](map_1/while/TensorArrayReadV3, map_1/while/TensorArrayReadV3_1/_2287, map_1/while/TensorArrayReadV3_2, map_1/while/TensorArrayReadV3_3/_2289)]]
             [[{{node map/while/TensorArrayWrite/TensorArrayWriteV3/_2359}} = _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_1747_map/while/TensorArrayWrite/TensorArrayWriteV3", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"](^_cloopmap/while/NextIteration_2/_2188)]]

0 个答案:

没有答案