I’ve tried to run my model - the UDP check is irrelevant now in the function call. This model takes 100 steps and 2 features per sample - hence the (100, 2) input shape.
class KnownDetector(Model):
def __init__(self):
super(KnownDetector, self).__init__()
self.TCP = tf.keras.Sequential([
layers.Conv1D(filters=32, kernel_size=3, activation="relu", input_shape=(100, 2)), # 100 packets, 2 features
layers.MaxPool1D(pool_size=3, padding='same'),
layers.Conv1D(filters=32, kernel_size=3, activation="relu"), # 100 packets, 2 features
layers.MaxPool1D(pool_size=3, padding='same'),
layers.Conv1D(filters=32, kernel_size=3, activation="relu"), # 100 packets, 2 features
layers.Dense(128),
tf.keras.layers.Softmax()
])
def call(self, x):
flag = True # check if x is TCP or UDP in the future
if flag:
return self.TCP(x)
fx = KnownDetector()
fx.compile()
fx.fit(train, train_labels, epochs=1, validation_data=(test, test_labels), batch_size=32)
However, I keep getting this error:
I’ve looked online and it seems like many of the solved issues aren’t relevant to me. Why does this happen and how do I fix it?