SSD-Tensorflow:TypeError: Can not convert a tuple into a Tensor or Operation
来源:互联网 发布:蜜缘快约软件 编辑:程序博客网 时间:2024/06/02 07:05
我在用这个模型进行评估的时候,遇见了上述这个问题,直接用github上的命令是有问题的,我的环境是python3, tensorflow 1.4,ubuntu16.04,结果就报错了:
TypeError: Can not convert a tuple into a Tensor or Operation
然后,自己对这个tensorflow编程不了解,沉寂了好长时间,我的命令是:
DATASET_DIR=tfrecords_test_v3EVAL_DIR=logs/CHECKPOINT_PATH=./checkpoints/VGG_VOC0712_SSD_300x300_ft_iter_120000.ckptpython3 eval_ssd_network.py \ --eval_dir=${EVAL_DIR} \ --dataset_dir=${DATASET_DIR} \ --dataset_name=pascalvoc_2007 \ --dataset_split_name=test \ --model_name=ssd_300_vgg \ --checkpoint_path=${CHECKPOINT_PATH} \ --batch_size=1
后面,有人在github上解决了这个问题,我在此分享给大家,打开eval_ssd_network.py文件,然后加入以下代码:
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)
参考文献
[1].TypeError: Can not convert a tuple into a Tensor or Operation. https://github.com/balancap/SSD-Tensorflow/issues/154
阅读全文
0 0
- SSD-Tensorflow:TypeError: Can not convert a tuple into a Tensor or Operation
- TypeError: Can not convert a float32 into a Tensor or Operation.
- Cannot interpret feed_dict key as Tensor: Can not convert a method into a Tensor.
- How to convert a list of tensors into a tensor
- TypeError: view must be a callable or a list/tuple in the case of include()
- TypeError: view must be a callable or a list/tuple in the case of include().
- TypeError: view must be a callable or a list/tuple in the case of include().解决办法
- TypeError: view must be a callable or a list/tuple in the case of include()
- TypeError: view must be a callable or a list/tuple in the case of include()
- TensorFlow的图像预处理报错ValueError: Tried to convert ‘min_object_covered’ to a tensor and failed.
- Your STATICFILES_DIRS setting is not a tuple or list
- Convert a console project into a Win32 GUI project or the other way around.
- How to convert an OpenCV cv::Mat into a float* that can be fed into Vlfeat vl_dsift_process ?
- (codes)a program convert a dec into a hex
- convert an int into a byte array
- gen already exists but is not a source folder. Convert to a source folder or
- /gen already exists but is not a source folder. Convert to a source folder or rename
- Uncaught TypeError: Super expression must either be null or a function, not undefine
- Qt怎么打包程序
- 学习历程—程序设计基础(一)
- 微信小程序之报错—pages/welcome/welcome 出现脚本错误或者未正确调用 Page()是什么问题?
- 为MyEclipse 9/10中的html/JSP编辑器添加代码自动提示
- 【转载:总有人会解决你的问题】eclipse被maven搞得无法启动
- SSD-Tensorflow:TypeError: Can not convert a tuple into a Tensor or Operation
- 树莓派RaspBerryPi上使用3g模块
- 测试人眼中的车联网(比亚迪云服务-3.2.1)——查找充电桩
- 网络流24题:餐巾计划问题
- 计算机视觉方向推荐
- mysql 定时任务 event
- 转载-3分钟了解入门「机器学习」该学习什么?(上)
- adb install failed(base.apk code is missing)
- 每日一点linux:$PATH下目录简介