SSD-Tensorflow:TypeError: Can not convert a tuple into a Tensor or Operation:此问题在github有详细解答,具体以下,打开eval_ssd_network.py文件,而后加入如下代码:git
def flatten(x): result = [] for el in x: if isinstance(el, tuple): result.extend(flatten(el)) else: result.append(el) return result
# Waiting loop. slim.evaluation.evaluation_loop( master=FLAGS.master, checkpoint_dir=checkpoint_path, logdir=FLAGS.eval_dir, num_evals=num_batches, eval_op=flatten(list(names_to_updates.values())), #这里调用flatten variables_to_restore=variables_to_restore, eval_interval_secs=60, max_number_of_evaluations=np.inf, session_config=config, timeout=None) # Standard evaluation loop. start = time.time() slim.evaluation.evaluate_once( master=FLAGS.master, checkpoint_path=checkpoint_path, logdir=FLAGS.eval_dir, num_evals=num_batches, eval_op=flatten(list(names_to_updates.values())), #这里也调用flatten variables_to_restore=variables_to_restore, session_config=config)
本问题是在编译tensorflow-ssd源码时遇到的https://github.com/balancap/SSD-Tensorflow,参考连接为https://github.com/balancap/SSD-Tensorflow/issues/154github