ageron / ageron/handson-ml2

Chapter 17: Bug in stacked autoencoder validation set

Aperta
#281 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Jupyter Notebook
Stelle
30k
Fork
13.1k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

This is a subtle one. Under "Stacked autoencoders" in the book, the model is fit with the fashion_mnist validation set passed twice in a python list:
```
history = stacked_ae.fit(X_train, X_train, epochs=20,
validation_data=[X_valid, X_valid])
```

However, this gives an error:
```
ValueError: Layer sequential_2 expects 1 inputs, but it received 2 input tensors. Inputs received: [, ]
```

On the other hand, in notebook on github the validation set is passed as a tuple instead of a list:
```
history = stacked_ae.fit(X_train, X_train, epochs=20,
validation_data=(X_valid, X_valid))
```
And this time it works! This feels like a Keras/TensorFlow issue, but the notation in the main chapter needs to be fixed either way.

(Found using Python 3.8.5 and TensorFlow 2.3.1)

-A

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.