philipperemy/keras-tcn

[help] prediction

davircarvalho opened this issue · 0 comments

Hello,

I have trained a classification model using a compiled_tcn,:

`model = compiled_tcn(return_sequences=False,
num_feat=x_train.shape[2],
num_classes=7,
nb_filters=64,
kernel_size=8,
dilations=[2 ** i for i in range(8)],
nb_stacks=2,
dropout_rate=0.2,
use_batch_norm=True,
max_len=x_train[0:1].shape[1],
use_skip_connections=True,
use_layer_norm=True,
opt='rmsprop')

early_stopping = EarlyStopping(patience=10)
model.summary()
cnnhistory = model.fit(x_train, y_train,
batch_size = batch_size,
validation_data=(x_test, y_test),
epochs = epochs,
callbacks=[clr, early_stopping])`

Now I'm trying to predict the results for unknown data using the following code:
predictions = model.predict_classes(x_test)

but I get the error : AttributeError: 'Model' object has no attribute 'predict_classes'

And if I try:
predictions = model.predict(x_test)

I get the error : AttributeError: 'Operation' object has no attribute '_c_op'

What am I missing? Any help is appreciated