首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Tensorflow对象检测api示例不适用于Tensorflow 1x

Tensorflow对象检测api示例不适用于Tensorflow 1x
EN

Stack Overflow用户
提问于 2020-05-09 19:24:50
回答 1查看 203关注 0票数 0

这是我的第一个ML项目,所以我可能在理解上犯了一个错误。我已经使用教程Tensorflow Object Detection API Github训练了一个自定义模型。我很困惑,因为这个页面说目前的对象检测api不支持TensorFlow2.x。然而,当我阅读demo时,它要求安装TensorFlow2.x。

我不明白当对象检测api不支持tensorflow v2.x时,为什么demo要求安装tensorflow v2.x?你们能帮我理解一下吗?我一定漏掉了什么。

编辑1:当我尝试使用Tensorflow 1.15运行演示脚本时,出现以下错误

代码语言:javascript
复制
File "object_detection_custom.py", line 71, in run_inference_for_single_image
    num_detections = int(output_dict.pop('num_detections'))
TypeError: int() argument must be a string or a number, not 'Tensor'

编辑2:下面是模型调用的输出

代码语言:javascript
复制
{
    u 'detection_boxes': < tf.Tensor 'StatefulPartitionedCall:0' shape = ( ? , 100, 4) dtype = float32 > , 
    u 'detection_classes': < tf.Tensor 'StatefulPartitionedCall:1' shape = ( ? , 100) dtype = float32 > , 
    u 'raw_detection_scores': < tf.Tensor 'StatefulPartitionedCall:6' shape = ( ? , ? , 2) dtype = float32 > , 
    u 'detection_scores': < tf.Tensor 'StatefulPartitionedCall:3' shape = ( ? , 100) dtype = float32 > , 
    u 'detection_multiclass_scores': < tf.Tensor 'StatefulPartitionedCall:2' shape = ( ? , 100, 2) dtype = float32 > , 
    u 'num_detections': < tf.Tensor 'StatefulPartitionedCall:4' shape = ( ? , ) dtype = float32 > , 
    u 'raw_detection_boxes': < tf.Tensor 'StatefulPartitionedCall:5' shape = ( ? , ? , 4) dtype = float32 >
}
EN

回答 1

Stack Overflow用户

发布于 2020-07-09 09:59:22

您上面引用的演示链接已断开,但您引用的notebook具有moved。本教程确实使用了TensorFlow 2,但仅用于推理。培训需要TensorFlow 1.15。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61695979

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档