title: Loaded model returning random results
body: <p>I am new to python and neural networks and have been trying to load and my models in order to decrease my training time. I am practicing with a stock so that I can get used to building my models. However, I am running into an issue when it comes to the results of my loaded model.</p>
  <p>Here is my model:</p>
  <pre><code>checkpoint_path = &quot;training_1/1.ckpt&quot;
  checkpoint_dir = os.path.dirname(checkpoint_path)
  
  cp_callback = tf.keras.callbacks.ModelCheckpoint(checkpoint_path,save_weights_only=True,verbose=1)
  
  input0 = Input(shape=(X_volume_train.shape[1], 1))
  hidden111 = Dense(TOP)(input0)
  flat0 = tf.keras.layers.TimeDistributed(Flatten())(hidden111)
  hidden112 = LSTM(120, return_sequences=True,activation='relu', dropout=0.1)(flat0)
  hidden113 = LSTM(100, return_sequences=True,activation='relu', dropout=0.1)(hidden112)
  hidden114 = LSTM(80, return_sequences=True,activation='relu', dropout=0.1)(hidden113)
  hidden115 = LSTM(60, activation='relu', dropout=0.1)(hidden114)
  hidden116 = Dense(50)(hidden115)
  hidden117 = Dense(40)(hidden116)
  hidden118 = Dense(30)(hidden117)
  hidden119 = Dense(20)(hidden118)
  hidden120 = Dense(10)(hidden119)
  
  
  input1 = Input(shape=(X_volume_train.shape[1], 1))
  hidden211 = Dense(TOP)(input1)
  flat1 = tf.keras.layers.TimeDistributed(Flatten())(hidden211)
  hidden212 = LSTM(120, return_sequences=True,activation='relu', dropout=0.1)(flat1)
  hidden213 = LSTM(100, return_sequences=True,activation='relu', dropout=0.1)(hidden212)
  hidden214 = LSTM(80, return_sequences=True,activation='relu', dropout=0.1)(hidden213)
  hidden215 = LSTM(60, activation='relu', dropout=0.1)(hidden214)
  hidden216 = Dense(50)(hidden215)
  hidden217 = Dense(40)(hidden216)
  hidden218 = Dense(30)(hidden217)
  hidden219 = Dense(20)(hidden218)
  hidden220 = Dense(10)(hidden219)
  
  input2 = Input(shape=(X_volume_train.shape[1], 1))
  hidden311 = Dense(TOP)(input2)
  flat2 = tf.keras.layers.TimeDistributed(Flatten())(hidden311)
  hidden312 = LSTM(120, return_sequences=True,activation='relu', dropout=0.1)(flat2)
  hidden313 = LSTM(100, return_sequences=True,activation='relu', dropout=0.1)(hidden312)
  hidden314 = LSTM(80, return_sequences=True,activation='relu', dropout=0.1)(hidden313)
  hidden315 = LSTM(60, activation='relu', dropout=0.1)(hidden314)
  hidden316 = Dense(50)(hidden315)
  hidden317 = Dense(40)(hidden316)
  hidden318 = Dense(30)(hidden317)
  hidden319 = Dense(20)(hidden318)
  hidden320 = Dense(10)(hidden319)
  
  input3 = Input(shape=(X_volume_train.shape[1], 1))
  hidden411 = Dense(TOP)(input3)
  flat3 = tf.keras.layers.TimeDistributed(Flatten())(hidden411)
  hidden412 = LSTM(120, return_sequences=True,activation='relu', dropout=0.1)(flat3)
  hidden413 = LSTM(100, return_sequences=True,activation='relu', dropout=0.1)(hidden412)
  hidden414 = LSTM(80, return_sequences=True,activation='relu', dropout=0.1)(hidden413)
  hidden415 = LSTM(60, activation='relu', dropout=0.1)(hidden414)
  hidden416 = Dense(50)(hidden415)
  hidden417 = Dense(40)(hidden416)
  hidden418 = Dense(30)(hidden417)
  hidden419 = Dense(20)(hidden418)
  hidden420 = Dense(10)(hidden419)
  
  input4 = Input(shape=(X_volume_train.shape[1], 1))
  hidden511 = Dense(TOP)(input4)
  flat4 = tf.keras.layers.TimeDistributed(Flatten())(hidden511)
  hidden512 = LSTM(120, return_sequences=True,activation='relu', dropout=0.1)(flat4)
  hidden513 = LSTM(100, return_sequences=True,activation='relu', dropout=0.1)(hidden512)
  hidden514 = LSTM(80, return_sequences=True,activation='relu', dropout=0.1)(hidden513)
  hidden515 = LSTM(60, activation='relu', dropout=0.1)(hidden514)
  hidden516 = Dense(50)(hidden515)
  hidden517 = Dense(40)(hidden516)
  hidden518 = Dense(30)(hidden517)
  hidden519 = Dense(20)(hidden518)
  hidden520 = Dense(10)(hidden519)
  
  input5 = Input(shape=(X_volume_train.shape[1], 1))
  hidden611 = Dense(TOP)(input3)
  flat5 = tf.keras.layers.TimeDistributed(Flatten())(hidden611)
  hidden612 = LSTM(120, return_sequences=True,activation='relu', dropout=0.1)(flat5)
  hidden613 = LSTM(100, return_sequences=True,activation='relu', dropout=0.1)(hidden612)
  hidden614 = LSTM(80, return_sequences=True,activation='relu', dropout=0.1)(hidden613)
  hidden615 = LSTM(60, activation='relu', dropout=0.1)(hidden614)
  hidden616 = Dense(50)(hidden615)
  hidden617 = Dense(40)(hidden616)
  hidden618 = Dense(30)(hidden617)
  hidden619 = Dense(20)(hidden618)
  hidden620 = Dense(10)(hidden619)
  
  input6 = Input(shape=(X_volume_train.shape[1], 1))
  hidden711 = Dense(TOP)(input6)
  flat6 = tf.keras.layers.TimeDistributed(Flatten())(hidden711)
  hidden712 = LSTM(120, return_sequences=True,activation='relu', dropout=0.1)(flat6)
  hidden713 = LSTM(100, return_sequences=True,activation='relu', dropout=0.1)(hidden712)
  hidden714 = LSTM(80, return_sequences=True,activation='relu', dropout=0.1)(hidden713)
  hidden715 = LSTM(60, activation='relu', dropout=0.1)(hidden714)
  hidden716 = Dense(50)(hidden715)
  hidden717 = Dense(40)(hidden716)
  hidden718 = Dense(30)(hidden717)
  hidden719 = Dense(20)(hidden718)
  hidden720 = Dense(10)(hidden719)
  
  concate_input = layers.Concatenate()([hidden120, hidden220,hidden320, hidden420,hidden520,hidden620,hidden720])
  
  output1 = Dense(50)(concate_input)
  output2 = Dense(1)(output1)
  
  # multi-input , multi-output
  model = keras.Model( inputs = [input0, input1, input2, input3, input4, input5, input6], 
                      outputs = [output2])
  
  
  model.compile(loss=LOSS, metrics=[&quot;mean_absolute_error&quot;], optimizer=OPTIMIZER)
  
  
  model.fit([X_high_train,X_volume_train,X_open_train,X_low_train,X_close_train,X_adj_train,X_rsi_train],
                    [y_high_train],
                    epochs=EPOCHS,
                    callbacks = [cp_callback],
                    verbose=1)
  </code></pre>
  <p>After this I handle my preprocessing again and then use the keras.model.load function in order to make my predictions.</p>
  <p>Here is the load section:</p>
  <pre><code>def MODEL():
  input0 = Input(shape=(X_volume_train.shape[1], 1))
  hidden111 = Dense(TOP)(input0)
  flat0 = tf.keras.layers.TimeDistributed(Flatten())(hidden111)
  hidden112 = LSTM(120, return_sequences=True,activation='relu', dropout=0.1)(flat0)
  hidden113 = LSTM(100, return_sequences=True,activation='relu', dropout=0.1)(hidden112)
  hidden114 = LSTM(80, return_sequences=True,activation='relu', dropout=0.1)(hidden113)
  hidden115 = LSTM(60, activation='relu', dropout=0.1)(hidden114)
  hidden116 = Dense(50)(hidden115)
  hidden117 = Dense(40)(hidden116)
  hidden118 = Dense(30)(hidden117)
  hidden119 = Dense(20)(hidden118)
  hidden120 = Dense(10)(hidden119)
  
  
  input1 = Input(shape=(X_volume_train.shape[1], 1))
  hidden211 = Dense(TOP)(input1)
  flat1 = tf.keras.layers.TimeDistributed(Flatten())(hidden211)
  hidden212 = LSTM(120, return_sequences=True,activation='relu', dropout=0.1)(flat1)
  hidden213 = LSTM(100, return_sequences=True,activation='relu', dropout=0.1)(hidden212)
  hidden214 = LSTM(80, return_sequences=True,activation='relu', dropout=0.1)(hidden213)
  hidden215 = LSTM(60, activation='relu', dropout=0.1)(hidden214)
  hidden216 = Dense(50)(hidden215)
  hidden217 = Dense(40)(hidden216)
  hidden218 = Dense(30)(hidden217)
  hidden219 = Dense(20)(hidden218)
  hidden220 = Dense(10)(hidden219)
  
  input2 = Input(shape=(X_volume_train.shape[1], 1))
  hidden311 = Dense(TOP)(input2)
  flat2 = tf.keras.layers.TimeDistributed(Flatten())(hidden311)
  hidden312 = LSTM(120, return_sequences=True,activation='relu', dropout=0.1)(flat2)
  hidden313 = LSTM(100, return_sequences=True,activation='relu', dropout=0.1)(hidden312)
  hidden314 = LSTM(80, return_sequences=True,activation='relu', dropout=0.1)(hidden313)
  hidden315 = LSTM(60, activation='relu', dropout=0.1)(hidden314)
  hidden316 = Dense(50)(hidden315)
  hidden317 = Dense(40)(hidden316)
  hidden318 = Dense(30)(hidden317)
  hidden319 = Dense(20)(hidden318)
  hidden320 = Dense(10)(hidden319)
  
  input3 = Input(shape=(X_volume_train.shape[1], 1))
  hidden411 = Dense(TOP)(input3)
  flat3 = tf.keras.layers.TimeDistributed(Flatten())(hidden411)
  hidden412 = LSTM(120, return_sequences=True,activation='relu', dropout=0.1)(flat3)
  hidden413 = LSTM(100, return_sequences=True,activation='relu', dropout=0.1)(hidden412)
  hidden414 = LSTM(80, return_sequences=True,activation='relu', dropout=0.1)(hidden413)
  hidden415 = LSTM(60, activation='relu', dropout=0.1)(hidden414)
  hidden416 = Dense(50)(hidden415)
  hidden417 = Dense(40)(hidden416)
  hidden418 = Dense(30)(hidden417)
  hidden419 = Dense(20)(hidden418)
  hidden420 = Dense(10)(hidden419)
  
  input4 = Input(shape=(X_volume_train.shape[1], 1))
  hidden511 = Dense(TOP)(input4)
  flat4 = tf.keras.layers.TimeDistributed(Flatten())(hidden511)
  hidden512 = LSTM(120, return_sequences=True,activation='relu', dropout=0.1)(flat4)
  hidden513 = LSTM(100, return_sequences=True,activation='relu', dropout=0.1)(hidden512)
  hidden514 = LSTM(80, return_sequences=True,activation='relu', dropout=0.1)(hidden513)
  hidden515 = LSTM(60, activation='relu', dropout=0.1)(hidden514)
  hidden516 = Dense(50)(hidden515)
  hidden517 = Dense(40)(hidden516)
  hidden518 = Dense(30)(hidden517)
  hidden519 = Dense(20)(hidden518)
  hidden520 = Dense(10)(hidden519)
  
  input5 = Input(shape=(X_volume_train.shape[1], 1))
  hidden611 = Dense(TOP)(input3)
  flat5 = tf.keras.layers.TimeDistributed(Flatten())(hidden611)
  hidden612 = LSTM(120, return_sequences=True,activation='relu', dropout=0.1)(flat5)
  hidden613 = LSTM(100, return_sequences=True,activation='relu', dropout=0.1)(hidden612)
  hidden614 = LSTM(80, return_sequences=True,activation='relu', dropout=0.1)(hidden613)
  hidden615 = LSTM(60, activation='relu', dropout=0.1)(hidden614)
  hidden616 = Dense(50)(hidden615)
  hidden617 = Dense(40)(hidden616)
  hidden618 = Dense(30)(hidden617)
  hidden619 = Dense(20)(hidden618)
  hidden620 = Dense(10)(hidden619)
  
  input6 = Input(shape=(X_volume_train.shape[1], 1))
  hidden711 = Dense(TOP)(input6)
  flat6 = tf.keras.layers.TimeDistributed(Flatten())(hidden711)
  hidden712 = LSTM(120, return_sequences=True,activation='relu', dropout=0.1)(flat6)
  hidden713 = LSTM(100, return_sequences=True,activation='relu', dropout=0.1)(hidden712)
  hidden714 = LSTM(80, return_sequences=True,activation='relu', dropout=0.1)(hidden713)
  hidden715 = LSTM(60, activation='relu', dropout=0.1)(hidden714)
  hidden716 = Dense(50)(hidden715)
  hidden717 = Dense(40)(hidden716)
  hidden718 = Dense(30)(hidden717)
  hidden719 = Dense(20)(hidden718)
  hidden720 = Dense(10)(hidden719)
  
  concate_input = layers.Concatenate()([hidden120, hidden220,hidden320, hidden420,hidden520,hidden620,hidden720])
  
  output1 = Dense(50)(concate_input)
  output2 = Dense(1)(output1)
  
  # multi-input , multi-output
  model = keras.Model( inputs = [input0, input1, input2, input3, input4, input5, input6], 
                      outputs = [output2])
  
  
  model.compile(loss=LOSS, metrics=[&quot;mean_absolute_error&quot;], optimizer=OPTIMIZER)
  return model
  
  model = MODEL()
  model.load_weights(&quot;/content/training_1/1.ckpt&quot;)
  </code></pre>
  <p>It works fine without saving out the weights and then loading, however, using this method I am significantly off (90%) in all of my predictions. Any help or guidance would be appreciated!
  Thank you so much.</p>