ioe
Ensign
- Registriert
- Nov. 2014
- Beiträge
- 174
Hallo Forum
Ich versuche mich seit ein paar Tagen an einem Projekt das Tensorflow verwendet.
Es geht darum, dass ich ein Model trainieren möchte, welches eine 2D Matrix (478x3) als Input und eine 1D Array (70) als Output hat.
Für das Training stehen 500 Datensätze breit.
So wie ich das verstehe sollte das ja so funktionieren:
Das Dataset sieht so aus:
Aber egal was ich anstelle, entweder erhalte ich eine Fehlermeldung oder die Prediction ist sehr schlecht.
Habt ihr eine Idee was ich hier falsch mache?
Hier erhalte ich zb diese Meldung:
vg
Ich versuche mich seit ein paar Tagen an einem Projekt das Tensorflow verwendet.
Es geht darum, dass ich ein Model trainieren möchte, welches eine 2D Matrix (478x3) als Input und eine 1D Array (70) als Output hat.
Für das Training stehen 500 Datensätze breit.
So wie ich das verstehe sollte das ja so funktionieren:
Python:
model = Sequential()
model.add(Input(shape=(478, 3)))
model.add(Flatten())
model.add(Dense(units=4096, activation='relu'))
...
model.add(Dense(units=128, activation='relu'))
model.add(Dense(units=70))
model.compile(loss='binary_crossentropy', optimizer='sgd', metrics=[Accuracy()])
model.fit(dataSet, epochs=1200, batch_size=32)
Das Dataset sieht so aus:
Python:
input = tf.constant( [ [ 1.0, 1.0, 1.0 ], [1.0, 1.0, 1.0 ], ... ], ... ] ) # 500x478x3
output = tf.constant([ [ 1.0, 1.0, 1.0, ... ], ...] ) # 500x70
dataSet = tf.data.Dataset.from_tensor_slices((input, output))
Aber egal was ich anstelle, entweder erhalte ich eine Fehlermeldung oder die Prediction ist sehr schlecht.
Habt ihr eine Idee was ich hier falsch mache?
Hier erhalte ich zb diese Meldung:
Invalid input shape for input Tensor("data:0", shape=(478, 3), dtype=float32). Expected shape (None, 478, 3), but input has incompatible shape (478, 3)
vg
Zuletzt bearbeitet: