在禁用急切执行模式的情况下训练对象检测模型。 (如何获得张量的值)

时间:2021-06-02 17:53:59

标签: tensorflow object-detection-api

我正在使用 tensorflow 2.5.0 并在没有启用急切执行的情况下训练了我的对象检测模型。当我使用模型(图像:Union[np.ndarray,tf.Tensor])推理将图像传递给模型时,我得到以下结果python字典。我怎样才能得到这个张量的价值?调用 .numpy() 无法获取值,这在开启急切模式时通常会有所帮助。

谢谢

{'detection_scores': <tf.Tensor 'StatefulPartitionedCall:4' shape=(1, 30) dtype=float32>, 'detection_boxes': <tf.Tensor 'StatefulPartitionedCall:0' shape=(1, 30, 
4) dtype=float32>, 'num_detections': <tf.Tensor 'StatefulPartitionedCall:5' shape=(1,) dtype=float32>, 'detection_boxes_strided': <tf.Tensor 'StatefulPartitionedC
all:1' shape=(1, 30, 4) dtype=float32>, 'detection_classes': <tf.Tensor 'StatefulPartitionedCall:2' shape=(1, 30) dtype=float32>, 'detection_multiclass_scores': <
tf.Tensor 'StatefulPartitionedCall:3' shape=(1, 30, 24) dtype=float32>}

@Tensorflow 支持

0 个答案:

没有答案