Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: You are trying to load a weight file containing 0 layers into a model with 2 layers. #15

Open
WittmannF opened this issue Jul 10, 2019 · 0 comments

Comments

@WittmannF
Copy link

Code to replicate the error:

# 1. Import callbacks
from keras.models import Sequential
from keras.layers import Flatten, Dense, Conv2D, MaxPooling2D
from keras.callbacks import ModelCheckpoint
from keras.datasets import mnist
!pip install keras_lr_finder
from keras_lr_finder import LRFinder

# 2. Input Data
(X_train, y_train), (X_test, y_test) = mnist.load_data()

mean, std = X_train.mean(), X_train.std()
X_train, X_test = (X_train-mean)/std, (X_test-mean)/std

# 3. Define Model
model = Sequential([Flatten(),
                    Dense(512, activation='relu'),
                    Dense(10, activation='softmax')])


# 5. Train model
model.compile(loss='sparse_categorical_crossentropy', \
              metrics=['accuracy'], optimizer='adam')

lr_finder = LRFinder(model)

lr_finder.find(X_train, y_train, start_lr=0.0001, end_lr=1, batch_size=512, epochs=5)

Colab: https://colab.research.google.com/drive/1YDVTxHutTIeVKz7l7yUuZ7MtiLvTA4AJ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant