TypeError: Fetch argument 0 has invalid type , must be a string or Tensor. (Can not convert a int into a Tensor or Operation.)

时间:2022-06-01 17:03:03

6月5日的時候,修改dilated_seg.py(使用tensorflow)出現了報錯:

TypeError: Fetch argument 0 has invalid type <type 'int'>, must be a string or Tensor. (Can not convert a int into a Tensor or Operation.)

檢查後發現,是在定義了
acc_value =tf.reduce_mean(tf.keras.metrics.binary_accuracy(y_true=labels_tf, y_pred=output))
後,我還加了一句acc_value = 0.
把acc_value = 0 刪除了就不再報錯了