Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I am getting Nonetype Error (Import issue?) #24

Open
kyuheejo opened this issue Nov 23, 2020 · 3 comments
Open

I am getting Nonetype Error (Import issue?) #24

kyuheejo opened this issue Nov 23, 2020 · 3 comments

Comments

@kyuheejo
Copy link

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..

@welaury
Copy link

welaury commented Dec 3, 2020

hello, have you found a solution to the problem?

@4pygmalion
Copy link

4pygmalion commented Mar 2, 2021

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]`

@jizhang02
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants