这是我的第一个ML项目,所以我可能在理解上犯了一个错误。我已经使用教程Tensorflow Object Detection API Github训练了一个自定义模型。我很困惑,因为这个页面说目前的对象检测api不支持TensorFlow2.x。然而,当我阅读demo时,它要求安装TensorFlow2.x。
我不明白当对象检测api不支持tensorflow v2.x时,为什么demo要求安装tensorflow v2.x?你们能帮我理解一下吗?我一定漏掉了什么。
编辑1:当我尝试使用Tensorflow 1.15运行演示脚本时,出现以下错误
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:下面是模型调用的输出
{
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 >
}发布于 2020-07-09 09:59:22
您上面引用的演示链接已断开,但您引用的notebook具有moved。本教程确实使用了TensorFlow 2,但仅用于推理。培训需要TensorFlow 1.15。
https://stackoverflow.com/questions/61695979
复制相似问题