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

Keras version problem #19

Closed
superguopeng opened this issue Jun 13, 2019 · 7 comments
Closed

Keras version problem #19

superguopeng opened this issue Jun 13, 2019 · 7 comments

Comments

@superguopeng
Copy link

I'm sorry I asked such a question,I used keras2.2.4,It was found 'Merge' that it could not be introduced in 'keras.layers.core ',But I found 'merge' in 'keras.layers',Unfortunately, the following error occurred
Thank you very much !
image

@entron
Copy link
Owner

entron commented Jun 13, 2019

I haven't used keras for sometime, from your error it seems keras changed the API for Reshape layer. Could you try to change the parameter name of Reshape from dim to target_shape?

@superguopeng
Copy link
Author

Thank you very much,I'll try your solution

@wmmxk
Copy link

wmmxk commented Jun 18, 2019

I haven't used keras for sometime, from your error it seems keras changed the API for Reshape layer. Could you try to change the parameter name of Reshape from dim to target_shape?

Do you still remember what version of Keras you used?

@entron
Copy link
Owner

entron commented Jun 20, 2019

I tested it with keras 2.1.5

@entron
Copy link
Owner

entron commented Jun 20, 2019

@superguopeng It would be great if you could create a pull request if you make it work with the latest keras.

@jackom
Copy link

jackom commented Sep 24, 2019

I'm also have the same probrem(keras's version also is 2.2.4), and I try to solve it with concatenate, but It occur other errors.My main codes is(models.py):

`

def __build_keras_model(self):
    models_in = []
    models_out = []

    # model_store = Sequential()
    # model_store.add(Embedding(1115, 50, input_length=1))
    # # model_store.add(Reshape(dims=(50,)))
    # model_store.add(Reshape((50,)))
    # models.append(model_store)
    # # models.append(model_store.output)

    model_store_in = Input(shape=(1,))
    models_in.append(model_store_in)
    model_store_out = Embedding(1115, 50, input_length=1)(model_store_in)
    model_store_out = Reshape(target_shape=(50,))(model_store_out)
    models_out.append(model_store_out)
    model_store = Model_Keras(model_store_in, model_store_out)

    # model_dow = Sequential()
    # model_dow.add(Embedding(7, 6, input_length=1))
    # # model_dow.add(Reshape(dims=(6,)))
    # model_dow.add(Reshape((6,)))
    # models.append(model_dow)
    # # models.append(model_dow.output)

    model_dow_in = Input(shape=(1,))
    models_in.append(model_dow_in)
    model_dow_out = Embedding(7, 6, input_length=1)(model_dow_in)
    model_dow_out = Reshape(target_shape=(6,))(model_dow_out)
    models_out.append(model_dow_out)
    model_dow = Model_Keras(model_dow_in, model_dow_out)

    # model_promo = Sequential()
    # model_promo.add(Dense(1, input_dim=1))
    # models.append(model_promo)
    # # models.append(model_promo.output)

    model_promo_in = Input(shape=(1,))
    models_in.append(model_promo_in)
    model_promo_out = Dense(1, input_dim=1)(model_promo_in)
    models_out.append(model_promo_out)
    model_promo = Model_Keras(model_promo_in, model_promo_out)

    # model_year = Sequential()
    # model_year.add(Embedding(3, 2, input_length=1))
    # # model_year.add(Reshape(dims=(2,)))
    # model_year.add(Reshape((2,)))
    # models.append(model_year)
    # # models.append(model_year.output)

    model_year_in = Input(shape=(1,))
    models_in.append(model_year_in)
    model_year_out = Embedding(3, 2, input_length=1)(model_year_in)
    model_year_out = Reshape(target_shape=(2,))(model_year_out)
    models_out.append(model_year_out)
    model_year = Model_Keras(model_year_in, model_year_out)

    # model_month = Sequential()
    # model_month.add(Embedding(12, 6, input_length=1))
    # # model_month.add(Reshape(dims=(6,)))
    # model_month.add(Reshape((6,)))
    # models.append(model_month)
    # # models.append(model_month.output)

    model_month_in = Input(shape=(1,))
    models_in.append(model_month_in)
    model_month_out = Embedding(12, 6, input_length=1)(model_month_in)
    model_month_out = Reshape(target_shape=(6,))(model_month_out)
    models_out.append(model_month_out)
    model_month = Model_Keras(model_month_in, model_month_out)

    # model_day = Sequential()
    # model_day.add(Embedding(31, 10, input_length=1))
    # # model_day.add(Reshape(dims=(10,)))
    # model_day.add(Reshape((10,)))
    # models.append(model_day)
    # # models.append(model_day.output)

    model_day_in = Input(shape=(1,))
    models_in.append(model_day_in)
    model_day_out = Embedding(31, 10, input_length=1)(model_day_in)
    model_day_out = Reshape(target_shape=(10,))(model_day_out)
    models_out.append(model_day_out)
    model_day = Model_Keras(model_day_in, model_day_out)

    # model_stateholiday = Sequential()
    # model_stateholiday.add(Embedding(4, 3, input_length=1))
    # # model_stateholiday.add(Reshape(dims=(3,)))
    # model_stateholiday.add(Reshape((3,)))
    # models.append(model_stateholiday)
    # # models.append(model_stateholiday.output)

    model_stateholiday_in = Input(shape=(1,))
    models_in.append(model_stateholiday_in)
    model_stateholiday_out = Embedding(4, 3, input_length=1)(model_stateholiday_in)
    model_stateholiday_out = Reshape(target_shape=(3,))(model_stateholiday_out)
    models_out.append(model_stateholiday_out)
    model_stateholiday = Model_Keras(model_stateholiday_in, model_stateholiday_out)

    # model_school = Sequential()
    # model_school.add(Dense(1, input_dim=1))
    # models.append(model_school)
    # # models.append(model_school.output)

    model_school_in = Input(shape=(1,))
    models_in.append(model_school_in)
    model_school_out = Dense(1, input_dim=1)(model_school_in)
    models_out.append(model_school_out)
    model_school = Model_Keras(model_school_in, model_school_out)

    # model_competemonths = Sequential()
    # model_competemonths.add(Embedding(25, 2, input_length=1))
    # # model_competemonths.add(Reshape(dims=(2,)))
    # model_competemonths.add(Reshape((2,)))
    # models.append(model_competemonths)
    # # models.append(model_competemonths.output)

    model_competemonths_in = Input(shape=(1,))
    models_in.append(model_competemonths_in)
    model_competemonths_out = Embedding(25, 2, input_length=1)(model_competemonths_in)
    model_competemonths_out = Reshape(target_shape=(2,))(model_competemonths_out)
    models_out.append(model_competemonths_out)
    model_competemonths = Model_Keras(model_competemonths_in, model_competemonths_out)

    # model_promo2weeks = Sequential()
    # model_promo2weeks.add(Embedding(26, 1, input_length=1))
    # # model_promo2weeks.add(Reshape(dims=(1,)))
    # model_promo2weeks.add(Reshape((1,)))
    # models.append(model_promo2weeks)
    # # models.append(model_promo2weeks.output)

    model_promo2weeks_in = Input(shape=(1,))
    models_in.append(model_promo2weeks_in)
    model_promo2weeks_out = Embedding(26, 1, input_length=1)(model_promo2weeks_in)
    model_promo2weeks_out = Reshape(target_shape=(1,))(model_promo2weeks_out)
    models_out.append(model_promo2weeks_out)
    model_promo2weeks = Model_Keras(model_promo2weeks_in, model_promo2weeks_out)

    # model_lastestpromo2months = Sequential()
    # model_lastestpromo2months.add(Embedding(4, 1, input_length=1))
    # # model_lastestpromo2months.add(Reshape(dims=(1,)))
    # model_lastestpromo2months.add(Reshape((1,)))
    # models.append(model_lastestpromo2months)
    # # models.append(model_lastestpromo2months.output)

    model_lastestpromo2months_in = Input(shape=(1,))
    models_in.append(model_lastestpromo2months_in)
    model_lastestpromo2months_out = Embedding(4, 1, input_length=1)(model_lastestpromo2months_in)
    model_lastestpromo2months_out = Reshape(target_shape=(1,))(model_lastestpromo2months_out)
    models_out.append(model_lastestpromo2months_out)
    model_lastestpromo2months = Model_Keras(model_lastestpromo2months_in, model_lastestpromo2months_out)

    # model_distance = Sequential()
    # model_distance.add(Dense(1, input_dim=1))
    # models.append(model_distance)
    # # models.append(model_distance.output)

    model_distance_in = Input(shape=(1,))
    models_in.append(model_distance_in)
    model_distance_out = Dense(1, input_dim=1)(model_distance_in)
    models_out.append(model_distance_out)
    model_distance = Model_Keras(model_distance_in, model_distance_out)

    # model_storetype = Sequential()
    # model_storetype.add(Embedding(5, 2, input_length=1))
    # # model_storetype.add(Reshape(dims=(2,)))
    # model_storetype.add(Reshape((2,)))
    # models.append(model_storetype)
    # # models.append(model_storetype.output)

    model_storetype_in = Input(shape=(1,))
    models_in.append(model_storetype_in)
    model_storetype_out = Embedding(5, 2, input_length=1)(model_storetype_in)
    model_storetype_out = Reshape(target_shape=(2,))(model_storetype_out)
    models_out.append(model_storetype_out)
    model_storetype = Model_Keras(model_storetype_in, model_storetype_out)

    # model_assortment = Sequential()
    # model_assortment.add(Embedding(4, 3, input_length=1))
    # # model_assortment.add(Reshape(dims=(3,)))
    # model_assortment.add(Reshape((3,)))
    # models.append(model_assortment)
    # # models.append(model_assortment.output)

    model_assortment_in = Input(shape=(1,))
    models_in.append(model_assortment_in)
    model_assortment_out = Embedding(4, 3, input_length=1)(model_assortment_in)
    model_assortment_out = Reshape(target_shape=(3,))(model_assortment_out)
    models_out.append(model_assortment_out)
    model_assortment = Model_Keras(model_assortment_in, model_assortment_out)

    # model_promointerval = Sequential()
    # model_promointerval.add(Embedding(4, 3, input_length=1))
    # # model_promointerval.add(Reshape(dims=(3,)))
    # model_promointerval.add(Reshape((3,)))
    # models.append(model_promointerval)
    # # models.append(model_promointerval.output)

    model_promointerval_in = Input(shape=(1,))
    models_in.append(model_promointerval_in)
    model_promointerval_out = Embedding(4, 3, input_length=1)(model_promointerval_in)
    model_promointerval_out = Reshape(target_shape=(3,))(model_promointerval_out)
    models_out.append(model_promointerval_out)
    model_promointerval = Model_Keras(model_promointerval_in, model_promointerval_out)

    # model_competyear = Sequential()
    # model_competyear.add(Embedding(18, 4, input_length=1))
    # # model_competyear.add(Reshape(dims=(4,)))
    # model_competyear.add(Reshape((4,)))
    # models.append(model_competyear)
    # # models.append(model_competyear.output)

    model_competyear_in = Input(shape=(1,))
    models_in.append(model_competyear_in)
    model_competyear_out = Embedding(18, 4, input_length=1)(model_competyear_in)
    model_competyear_out = Reshape(target_shape=(4,))(model_competyear_out)
    models_out.append(model_competyear_out)
    model_competyear = Model_Keras(model_competyear_in, model_competyear_out)

    # model_promotyear = Sequential()
    # model_promotyear.add(Embedding(8, 4, input_length=1))
    # # model_promotyear.add(Reshape(dims=(4,)))
    # model_promotyear.add(Reshape((4,)))
    # models.append(model_promotyear)
    # # models.append(model_promotyear.output)

    model_promotyear_in = Input(shape=(1,))
    models_in.append(model_promotyear_in)
    model_promotyear_out = Embedding(8, 4, input_length=1)(model_promotyear_in)
    model_promotyear_out = Reshape(target_shape=(4,))(model_promotyear_out)
    models_out.append(model_promotyear_out)
    model_promotyear = Model_Keras(model_promotyear_in, model_promotyear_out)

    # model_germanstate = Sequential()
    # model_germanstate.add(Embedding(12, 6, input_length=1))
    # # model_germanstate.add(Reshape(dims=(6,)))
    # model_germanstate.add(Reshape((6,)))
    # models.append(model_germanstate)
    # # models.append(model_germanstate.output)

    model_germanstate_in = Input(shape=(1,))
    models_in.append(model_germanstate_in)
    model_germanstate_out = Embedding(12, 6, input_length=1)(model_germanstate_in)
    model_germanstate_out = Reshape(target_shape=(6,))(model_germanstate_out)
    models_out.append(model_germanstate_out)
    model_germanstate = Model_Keras(model_germanstate_in, model_germanstate_out)

    # model_woy = Sequential()
    # model_woy.add(Embedding(53, 2, input_length=1))
    # # model_woy.add(Reshape(dims=(2,)))
    # model_woy.add(Reshape((2,)))
    # models.append(model_woy)
    # # models.append(model_woy.output)

    model_woy_in = Input(shape=(1,))
    models_in.append(model_woy_in)
    model_woy_out = Embedding(53, 2, input_length=1)(model_woy_in)
    model_woy_out = Reshape(target_shape=(2,))(model_woy_out)
    models_out.append(model_woy_out)
    model_woy = Model_Keras(model_woy_in, model_woy_out)

    # model_temperature = Sequential()
    # model_temperature.add(Dense(3, input_dim=3))
    # models.append(model_temperature)
    # # models.append(model_temperature.output)

    model_temperature_in = Input(shape=(1,))
    models_in.append(model_temperature_in)
    model_temperature_out = Dense(3, input_dim=3)(model_temperature_in)
    models_out.append(model_temperature_out)
    model_temperature = Model_Keras(model_temperature_in, model_temperature_out)

    # model_humidity = Sequential()
    # model_humidity.add(Dense(3, input_dim=3))
    # models.append(model_humidity)
    # # models.append(model_humidity.output)

    model_humidity_in = Input(shape=(1,))
    models_in.append(model_humidity_in)
    model_humidity_out = Dense(3, input_dim=3)(model_humidity_in)
    models_out.append(model_humidity_out)
    model_humidity = Model_Keras(model_humidity_in, model_humidity_out)

    # model_wind = Sequential()
    # model_wind.add(Dense(2, input_dim=2))
    # models.append(model_wind)
    # # models.append(model_wind.output)

    model_wind_in = Input(shape=(1,))
    models_in.append(model_wind_in)
    model_wind_out = Dense(2, input_dim=2)(model_wind_in)
    models_out.append(model_wind_out)
    model_wind = Model_Keras(model_wind_in, model_wind_out)

    # model_cloud = Sequential()
    # model_cloud.add(Dense(1, input_dim=1))
    # models.append(model_cloud)
    # # models.append(model_cloud.output)

    model_cloud_in = Input(shape=(1,))
    models_in.append(model_cloud_in)
    model_cloud_out = Dense(1, input_dim=1)(model_cloud_in)
    models_out.append(model_cloud_out)
    model_cloud = Model_Keras(model_cloud_in, model_cloud_out)

    # model_weatherevent = Sequential()
    # model_weatherevent.add(Embedding(22, 4, input_length=1))
    # # model_weatherevent.add(Reshape(dims=(4,)))
    # model_weatherevent.add(Reshape((4,)))
    # models.append(model_weatherevent)
    # # models.append(model_weatherevent.output)

    model_weatherevent_in = Input(shape=(1,))
    models_in.append(model_weatherevent_in)
    model_weatherevent_out = Embedding(22, 4, input_length=1)(model_weatherevent_in)
    model_weatherevent_out = Reshape(target_shape=(4,))(model_weatherevent_out)
    models_out.append(model_weatherevent_out)
    model_weatherevent = Model_Keras(model_weatherevent_in, model_weatherevent_out)

    # model_promo_forward = Sequential()
    # model_promo_forward.add(Embedding(8, 1, input_length=1))
    # # model_promo_forward.add(Reshape(dims=(1,)))
    # model_promo_forward.add(Reshape((1,)))
    # models.append(model_promo_forward)
    # # models.append(model_promo_forward.output)

    model_promo_forward_in = Input(shape=(1,))
    models_in.append(model_promo_forward_in)
    model_promo_forward_out = Embedding(8, 1, input_length=1)(model_promo_forward_in)
    model_promo_forward_out = Reshape(target_shape=(1,))(model_promo_forward_out)
    models_out.append(model_promo_forward_out)
    model_promo_forward = Model_Keras(model_promo_forward_in, model_promo_forward_out)

    # model_promo_backward = Sequential()
    # model_promo_backward.add(Embedding(8, 1, input_length=1))
    # # model_promo_backward.add(Reshape(dims=(1,)))
    # model_promo_backward.add(Reshape((1,)))
    # models.append(model_promo_backward)
    # # models.append(model_promo_backward.output)

    model_promo_backward_in = Input(shape=(1,))
    models_in.append(model_promo_backward_in)
    model_promo_backward_out = Embedding(8, 1, input_length=1)(model_promo_backward_in)
    model_promo_backward_out = Reshape(target_shape=(1,))(model_promo_backward_out)
    models_out.append(model_promo_backward_out)
    model_promo_backward = Model_Keras(model_promo_backward_in, model_promo_backward_out)

    # model_stateholiday_forward = Sequential()
    # model_stateholiday_forward.add(Embedding(8, 1, input_length=1))
    # # model_stateholiday_forward.add(Reshape(dims=(1,)))
    # model_stateholiday_forward.add(Reshape((1,)))
    # models.append(model_stateholiday_forward)
    # # models.append(model_stateholiday_forward.output)

    model_stateholiday_forward_in = Input(shape=(1,))
    models_in.append(model_stateholiday_forward_in)
    model_stateholiday_forward_out = Embedding(8, 1, input_length=1)(model_stateholiday_forward_in)
    model_stateholiday_forward_out = Reshape(target_shape=(1,))(model_stateholiday_forward_out)
    models_out.append(model_stateholiday_forward_out)
    model_stateholiday_forward = Model_Keras(model_stateholiday_forward_in, model_stateholiday_forward_out)

    # model_sateholiday_backward = Sequential()
    # model_sateholiday_backward.add(Embedding(8, 1, input_length=1))
    # # model_sateholiday_backward.add(Reshape(dims=(1,)))
    # model_sateholiday_backward.add(Reshape((1,)))
    # models.append(model_sateholiday_backward)
    # # models.append(model_sateholiday_backward.output)

    model_sateholiday_backward_in = Input(shape=(1,))
    models_in.append(model_sateholiday_backward_in)
    model_sateholiday_backward_out = Embedding(8, 1, input_length=1)(model_sateholiday_backward_in)
    model_sateholiday_backward_out = Reshape(target_shape=(1,))(model_sateholiday_backward_out)
    models_out.append(model_sateholiday_backward_out)
    model_sateholiday_backward = Model_Keras(model_sateholiday_backward_in, model_sateholiday_backward_out)

    # model_stateholiday_count_forward = Sequential()
    # model_stateholiday_count_forward.add(Embedding(3, 1, input_length=1))
    # # model_stateholiday_count_forward.add(Reshape(dims=(1,)))
    # model_stateholiday_count_forward.add(Reshape((1,)))
    # models.append(model_stateholiday_count_forward)
    # # models.append(model_stateholiday_count_forward.output)

    model_stateholiday_count_forward_in = Input(shape=(1,))
    models_in.append(model_stateholiday_count_forward_in)
    model_stateholiday_count_forward_out = Embedding(3, 1, input_length=1)(model_stateholiday_count_forward_in)
    model_stateholiday_count_forward_out = Reshape(target_shape=(1,))(model_stateholiday_count_forward_out)
    models_out.append(model_stateholiday_count_forward_out)
    model_stateholiday_count_forward = Model_Keras(model_stateholiday_count_forward_in, model_stateholiday_count_forward_out)

    # model_stateholiday_count_backward = Sequential()
    # model_stateholiday_count_backward.add(Embedding(3, 1, input_length=1))
    # # model_stateholiday_count_backward.add(Reshape(dims=(1,)))
    # model_stateholiday_count_backward.add(Reshape((1,)))
    # models.append(model_stateholiday_count_backward)
    # # models.append(model_stateholiday_count_backward.output)

    model_stateholiday_count_backward_in = Input(shape=(1,))
    models_in.append(model_stateholiday_count_backward_in)
    model_stateholiday_count_backward_out = Embedding(3, 1, input_length=1)(model_stateholiday_count_backward_in)
    model_stateholiday_count_backward_out = Reshape(target_shape=(1,))(model_stateholiday_count_backward_out)
    models_out.append(model_stateholiday_count_backward_out)
    model_stateholiday_count_backward = Model_Keras(model_stateholiday_count_backward_in, model_stateholiday_count_backward_out)

    # model_schoolholiday_forward = Sequential()
    # model_schoolholiday_forward.add(Embedding(8, 1, input_length=1))
    # # model_schoolholiday_forward.add(Reshape(dims=(1,)))
    # model_schoolholiday_forward.add(Reshape((1,)))
    # models.append(model_schoolholiday_forward)
    # # models.append(model_schoolholiday_forward.output)

    model_schoolholiday_forward_in = Input(shape=(1,))
    models_in.append(model_schoolholiday_forward_in)
    model_schoolholiday_forward_out = Embedding(8, 1, input_length=1)(model_schoolholiday_forward_in)
    model_schoolholiday_forward_out = Reshape(target_shape=(1,))(model_schoolholiday_forward_out)
    models_out.append(model_schoolholiday_forward_out)
    model_schoolholiday_forward = Model_Keras(model_schoolholiday_forward_in, model_schoolholiday_forward_out)

    # model_schoolholiday_backward = Sequential()
    # model_schoolholiday_backward.add(Embedding(8, 1, input_length=1))
    # # model_schoolholiday_backward.add(Reshape(dims=(1,)))
    # model_schoolholiday_backward.add(Reshape((1,)))
    # models.append(model_schoolholiday_backward)
    # # models.append(model_schoolholiday_backward.output)

    model_schoolholiday_backward_in = Input(shape=(1,))
    models_in.append(model_schoolholiday_backward_in)
    model_schoolholiday_backward_out = Embedding(8, 1, input_length=1)(model_schoolholiday_backward_in)
    model_schoolholiday_backward_out = Reshape(target_shape=(1,))(model_schoolholiday_backward_out)
    models_out.append(model_schoolholiday_backward_out)
    model_schoolholiday_backward = Model_Keras(model_schoolholiday_backward_in, model_schoolholiday_backward_out)

    # model_googletrend_de = Sequential()
    # model_googletrend_de.add(Dense(1, input_dim=1))
    # models.append(model_googletrend_de)
    # # models.append(model_googletrend_de.output)

    model_googletrend_de_in = Input(shape=(1,))
    models_in.append(model_googletrend_de_in)
    model_googletrend_de_out = Dense(1, input_dim=1)(model_googletrend_de_in)
    models_out.append(model_googletrend_de_out)
    model_googletrend_de = Model_Keras(model_googletrend_de_in, model_googletrend_de_out)

    # model_googletrend_state = Sequential()
    # model_googletrend_state.add(Dense(1, input_dim=1))
    # models.append(model_googletrend_state)
    # # models.append(model_googletrend_state.output)

    model_googletrend_state_in = Input(shape=(1,))
    models_in.append(model_googletrend_state_in)
    model_googletrend_state_out = Dense(1, input_dim=1)(model_googletrend_state_in)
    models_out.append(model_googletrend_state_out)
    model_googletrend_state = Model_Keras(model_googletrend_state_in, model_googletrend_state_out)

    # model_weather = Sequential()
    # model_weather.add(Merge([model_temperature, model_humidity, model_wind, model_weatherevent], mode='concat'))
    # model_weather.add(Dense(1))
    # model_weather.add(Activation('relu'))
    # models.append(model_weather)

    # self.model = Sequential()
    # self.model.add(Merge(models, mode='concat'))
    # self.model.add(Dropout(0.02))
    # self.model.add(Dense(1000, init='uniform'))
    # self.model.add(Activation('relu'))
    # self.model.add(Dense(500, init='uniform'))
    # self.model.add(Activation('relu'))
    # self.model.add(Dense(1))
    # self.model.add(Activation('sigmoid'))

    concatenated = concatenate(models_out)
    output = Dropout(0.02)(concatenated)
    output = Dense(1000, init='uniform')(output)
    output = Activation('relu')(output)
    output = Dense(500, init='uniform')(output)
    output = Activation('relu')(output)
    output = Dense(1)(output)
    output = Activation('sigmoid')(output)

    self.model = Model_Keras(models_in, output)

    self.model.compile(loss='mean_absolute_error', optimizer='Adam')

`

now When I run the file of "test_model.py" in pycharm, It occur the following erros:

`
nb_epoch=self.nb_epoch, batch_size=128,
File "/usr/local/lib/python3.7/site-packages/keras/engine/training.py", line 1154, in fit
batch_size=batch_size)

File "/usr/local/lib/python3.7/site-packages/keras/engine/training.py", line 579, in _standardize_user_data
exception_prefix='input')

File "/usr/local/lib/python3.7/site-packages/keras/engine/training_utils.py", line 145, in standardize_input_data
str(data_shape))
ValueError: Error when checking input: expected input_20 to have shape (1,) but got array with shape (3,)
`

and I don't known how to solve it! Could you help me please? @entron

models.py.zip
2381569317975_ pic_hd

@entron
Copy link
Owner

entron commented Jan 21, 2020

Tested the code with latest Keras (2.3.1) it seems everything is working fine. Therefore, I will close this issue.

@entron entron closed this as completed Jan 21, 2020
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

4 participants