marcellacornia/sam

'NoneType' object is not subscriptable

Leila-sd opened this issue · 2 comments

Hi,
help me to rectify this error
Traceback (most recent call last):
File "main.py", line 73, in
m = Model(input=[x, x_maps], output=sam_resnet([x, x_maps]))
File "\sam-master\models.py", line 136, in sam_resnet
nb_cols=3, nb_rows=3)(att_convlstm)
File "\sam-master\keras\engine\base_layer.py", line 457, in call
output = self.call(inputs, **kwargs)
File "\sam-master\attentive_convlstm.py", line 154, in call
input_length=input_shape[1])
File "\sam-master\keras\backend\theano_backend.py", line 1591, in rnn
go_backwards=go_backwards)
File "\Anaconda3\lib\site-packages\theano\scan_module\scan.py", line 773, in scan
condition, outputs, updates = scan_utils.get_updates_and_outputs(fn(*args))
File "\sam-master\keras\backend\theano_backend.py", line 1575, in _step
outputs, new_states = step_function(inputs, states)
File "\sam-master\attentive_convlstm.py", line 123, in step
a = K.reshape(K.softmax(K.batch_flatten(e)), (x_shape[0], 1, x_shape[2], x_shape[3]))
File "\sam-master\keras\backend\theano_backend.py", line 1101, in batch_flatten
if None in x._keras_shape[1:]:
TypeError: 'NoneType' object is not subscriptable
thanks

my keras version 1.1.0, theano version 0.9.0

Our code is compatible with Python 2.7, Keras 1.1.0 and Theano 0.9.0. Please also check your keras.json file (see the README for more details).