Open kyuheejo opened 3 years ago
hello, have you found a solution to the problem?
use tf.Tensor.shape attribution, instead of _tensor_shape function `if not isinstance(input_tensor, tf.Tensor): raise ValueError("Input tensor must be tf.Tensor")
filters = input_tensor.shape[channel_axis]`
Hello, to whom may be concerned:
During coding, I found that function_tensor_shape
is useless.
One can just write tensor.shape
instead of calling _tensor_shape
The Tensorflow version that I use is 2.7.0
Traceback (most recent call last): File "se_resnet.py", line 408, in
model = SEResNet50()
File "se_resnet.py", line 213, in SEResNet50
classes=classes)
File "se_resnet.py", line 138, in SEResNet
filters, depth, width, bottleneck, weight_decay, pooling)
File "se_resnet.py", line 376, in _create_se_resnet
x = _resnet_bottleneck_block(x, filters[0], width)
File "se_resnet.py", line 330, in _resnet_bottleneck_block
x = squeeze_excite_block(x)
File "/home/centos/anaconda3/envs/tensorflow2_p36/lib/python3.6/site-packages/keras_squeeze_excite_network-0.0.4-py3.6.egg/keras_squeeze_excite_network/se.py", line 26, in squeeze_excite_block
filters = _tensor_shape(init)[channel_axis]
TypeError: 'NoneType' object is not subscriptable
I don't understand why this is not working..