以下是我的代码:
TypeError: Using a `tf.Tensor` as a Python `bool` is not allowed. Use `if t is not None:` instead of `if t:` to test if a tensor is defined, and use TensorFlow ops such as tf.cond to execute subgraphs conditioned on the value of a tensor.
如果张量中的值小于0.5,那么它应该替换为0,否则为1.但它会一直返回错误。
.img-flux img {
border: 0;
max-height: 100%;
max-width: 100%;
height: auto;
width: 100%;
position: relative;
transition: all 0.3s;
margin: 0 auto;
float: none;
display: block;
vertical-align: middle;
}
答案 0 :(得分:4)