Hello,
I want to deploy my Car Price Predicition App on the Streamlit Cloud, but everytime I try to deploy it I get the following error message: ValueError: Layer ‘dense’ expected 2 variables, but received 0 variables during loading. Expected: [‘dense/kernel:0’, ‘dense/bias:0’]
When i deploy my app on my local machine everything works fine. I tried every solution I could find on in the internet but none of this works: redeploying the app several times, changing the requirement.txt, uninstall and reinstall anaconda, etc.
It seems like it has something to do with my keras model, becuase if I exclude the keras model the app will deploy and everythign works fine. My model structure is the following:
nn_model = keras.Sequential()
nn_model.add(keras.layers.Input(shape=(data_fitting.x_train.shape[1]),))
nn_model.add(keras.layers.Dense(units=200, activation=‘relu’, kernel_initializer=“normal”))
nn_model.add(keras.layers.Dropout(rate=0.15))
nn_model.add(keras.layers.Dense(units=100, activation=‘relu’, kernel_initializer=“normal”))
nn_model.add(keras.layers.Dropout(rate=0.15))
nn_model.add(keras.layers.Dense(units=10, activation=‘relu’, kernel_initializer=“normal”))
nn_model.add(keras.layers.Dense(units=1))
callback = keras.callbacks.EarlyStopping(monitor=‘val_mae’, patience=10, verbose=1, min_delta=4, mode=“min”)
opt = keras.optimizers.Adam(learning_rate=0.0001)
nn_model.compile(loss=keras.losses.MeanSquaredError(), optimizer=opt, metrics=[“mae”])
history = nn_model.fit(data_fitting.x_train, data_fitting.y_train, epochs=100, validation_split=0.25, callbacks= [callback])
I hope someone can help me. Here is the link to my Git Repo if you want to take a look at my entire code: GitHub - Konwoh/car_price_prediciton