Tensor._shape 是私有的,请使用 Tensor.shape 代替

Far*_*naz 1 python deep-learning keras

我将tensorflow 1.14.1与keras功能API一起使用,我需要在网络解码器部分的末尾进行插值。运行以下代码后出现错误:

conv_layer = Conv2D(32, (3, 3), padding='same', data_format='channels_first')(bn_pre)
act_layer = LeakyReLU()(conv_layer)
prm_layer = Permute((2, 3, 1))(act_layer)
ld1_layer = Lambda(lambda x: tf.image.resize(x, [384, 384]))(prm_layer)
prm2_layer = Permute((3, 1, 2))(ld1_layer)
bn12_layer = BatchNormalization(axis=1, scale=False)(prm2_layer)
Run Code Online (Sandbox Code Playgroud)

错误是:

W0116 17:40:42.326339 139793502861056 ops.py:465] Tensor._shape is private, use Tensor.shape instead. 
Tensor._shape will eventually be removed.
W0116 17:40:42.330794 139793502861056 ops.py:465] Tensor._shape is private, use Tensor.shape instead. 
Tensor._shape will eventually be removed.
Run Code Online (Sandbox Code Playgroud)

在哪里调用tensor._shape?我应该关心这个警告吗?以及如何修复它?

小智 5

应该是调试器吧 你不必太在意。检查这个