title: Invalid Argument Error Keras
body: <p>I was trying to make a neural network model for binary classification task. The model is like this</p>
  
  <pre><code>LEARNING_RATE_INIT = 0.001
  LEARNING_RATE_END = 0.0001
  BATCH_SIZE = 20000
  EPOCHS = 2
  
  EMBEDDING_N = 50
  DENSE_N = 1024
  
  SPATIAL_DROPOUT_1D = 0.2
  DROPOUT_1 = 0.2
  DROPOUT_2 = 0.2
  
  in_machine = Input(shape=[1], name='machine')
  emb_machine = Embedding(max_machine, EMBEDDING_N)(in_machine)
  
  in_windspeed = Input(shape=[1], name='windspeed')
  emb_windspeed = Embedding(max_windspeed, EMBEDDING_N)(in_windspeed)
  
  in_activepower = Input(shape=[1], name='activepower')
  emb_activepower = Embedding(max_activepower, EMBEDDING_N)(in_activepower)
  
  in_pitchangle = Input(shape=[1], name='pitchangle')
  emb_pitchangle = Embedding(max_pitchangle, EMBEDDING_N)(in_pitchangle)
  
  in_genspeed = Input(shape=[1], name='genspeed')
  emb_genspeed = Embedding(max_genspeed, EMBEDDING_N)(in_genspeed)
  
  in_temp = Input(shape=[1], name='temp')
  emb_temp = Embedding(max_temp, EMBEDDING_N)(in_temp)
  
  in_turbine = Input(shape=[1], name='turbine')
  emb_turbine = Embedding(max_turbine, EMBEDDING_N)(in_turbine)
  
  
  print('Create RNN Layers...')
  
  fe = concatenate([
      (emb_machine), 
      (emb_windspeed), 
      (emb_activepower), 
      (emb_pitchangle), 
      (emb_genspeed), 
      (emb_temp), 
      (emb_turbine)
  ])
  
  s_dout = SpatialDropout1D(SPATIAL_DROPOUT_1D)(fe)
  x = Flatten()(s_dout)
  
  x = Dropout(0.2)(Dense(1024,activation='relu')(x))
  x = Dropout(0.2)(Dense(256,activation='relu')(x))
  
  outp = Dense(1,activation='sigmoid')(x)
  
  model = Model(inputs=[in_machine, in_windspeed, in_activepower, in_pitchangle,
      in_genspeed, in_temp, in_turbine], outputs=outp)
  
  print('Model made')
  </code></pre>
  
  <p>It was compiled like this</p>
  
  <pre><code>model.compile(loss='binary_crossentropy', optimizer=optimizer_adam, metrics=['accuracy'])
  model.summary()
  </code></pre>
  
  <p>Model architecture is like shown below</p>
  
  <pre><code>__________________________________________________________________________________________________
  Layer (type)                    Output Shape         Param #     Connected to                     
  ==================================================================================================
  machine (InputLayer)            (None, 1)            0                                            
  __________________________________________________________________________________________________
  windspeed (InputLayer)          (None, 1)            0                                            
  __________________________________________________________________________________________________
  activepower (InputLayer)        (None, 1)            0                                            
  __________________________________________________________________________________________________
  pitchangle (InputLayer)         (None, 1)            0                                            
  __________________________________________________________________________________________________
  genspeed (InputLayer)           (None, 1)            0                                            
  __________________________________________________________________________________________________
  temp (InputLayer)               (None, 1)            0                                            
  __________________________________________________________________________________________________
  turbine (InputLayer)            (None, 1)            0                                            
  __________________________________________________________________________________________________
  embedding_48 (Embedding)        (None, 1, 50)        3700        machine[0][0]                    
  __________________________________________________________________________________________________
  embedding_49 (Embedding)        (None, 1, 50)        1200        windspeed[0][0]                  
  __________________________________________________________________________________________________
  embedding_50 (Embedding)        (None, 1, 50)        108000      activepower[0][0]                
  __________________________________________________________________________________________________
  embedding_51 (Embedding)        (None, 1, 50)        1500        pitchangle[0][0]                 
  __________________________________________________________________________________________________
  embedding_52 (Embedding)        (None, 1, 50)        78350       genspeed[0][0]                   
  __________________________________________________________________________________________________
  embedding_53 (Embedding)        (None, 1, 50)        3050        temp[0][0]                       
  __________________________________________________________________________________________________
  embedding_54 (Embedding)        (None, 1, 50)        100         turbine[0][0]                    
  __________________________________________________________________________________________________
  concatenate_6 (Concatenate)     (None, 1, 350)       0           embedding_48[0][0]               
                                                                   embedding_49[0][0]               
                                                                   embedding_50[0][0]               
                                                                   embedding_51[0][0]               
                                                                   embedding_52[0][0]               
                                                                   embedding_53[0][0]               
                                                                   embedding_54[0][0]               
  __________________________________________________________________________________________________
  spatial_dropout1d_3 (SpatialDro (None, 1, 350)       0           concatenate_6[0][0]              
  __________________________________________________________________________________________________
  flatten_17 (Flatten)            (None, 350)          0           spatial_dropout1d_3[0][0]        
  __________________________________________________________________________________________________
  dense_24 (Dense)                (None, 1024)         359424      flatten_17[0][0]                 
  __________________________________________________________________________________________________
  dropout_18 (Dropout)            (None, 1024)         0           dense_24[0][0]                   
  __________________________________________________________________________________________________
  dense_25 (Dense)                (None, 256)          262400      dropout_18[0][0]                 
  __________________________________________________________________________________________________
  dropout_19 (Dropout)            (None, 256)          0           dense_25[0][0]                   
  __________________________________________________________________________________________________
  dense_26 (Dense)                (None, 1)            257         dropout_19[0][0]                 
  ==================================================================================================
  Total params: 817,981
  Trainable params: 817,981
  Non-trainable params: 0
  __________________________________________________________________________________________________
  </code></pre>
  
  <p>While trying to fit the model I am getting following error.</p>
  
  <pre><code>InvalidArgumentError: indices[19577,0] = -3 is not in [0, 2160)
       [[Node: embedding_50/GatherV2 = GatherV2[Taxis=DT_INT32, Tindices=DT_INT32, Tparams=DT_FLOAT, _class=["loc:@training_3/Adam/gradients/embedding_50/GatherV2_grad/Reshape"], _device="/job:localhost/replica:0/task:0/device:CPU:0"](embedding_50/embeddings/read, embedding_50/Cast, embedding_48/GatherV2/axis)]]
  </code></pre>
  
  <p>What is the cause of this error.? How to fix this.?</p>
  
  <p>My input data contains negative values is that the problem.? Is there a way to incorporate negative values then.?</p>