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