philipperemy / keras-tcn

Keras Temporal Convolutional Network.
MIT License
1.87k stars 454 forks source link

AttributeError: 'tuple' object has no attribute 'as_list' #259

Closed ohilo12 closed 3 weeks ago

ohilo12 commented 2 months ago

Hello,

I have implemented a TNC layer.

The first attempt: from keras.models import Sequential from tcn import TCN

model = Sequential()
model.add( keras.Input(batch_size=None, shape=(None,5)) )
model.add( TCN(nb_filters=4, kernel_size=12, nb_stacks=1, 
              dilations=(1, 2, 4, 8), padding="same", use_skip_connections=True, dropout_rate=0.0, 
              return_sequences=False, activation="relu") ) 

The second attempt: from keras.models import Sequential from tcn import TCN

model = Sequential()    
model.add( TCN(nb_filters=4, kernel_size=12, nb_stacks=1, 
              dilations=(1, 2, 4, 8), padding="same", use_skip_connections=True, dropout_rate=0.0, 
              return_sequences=False, activation="relu", input_shape=(None, 5)) )

However, an error always occurs: AttributeError: 'tuple' object has no attribute 'as_list'

Is this a bug, or am I doing something wrong?

Kurdakov commented 2 months ago

it's Keras 3, see few issues before https://github.com/philipperemy/keras-tcn/issues/256

ohilo12 commented 1 month ago

Tnak you very much, it works now!

philipperemy commented 3 weeks ago

Should be fixed with https://github.com/philipperemy/keras-tcn/pull/262