<p><strong>EDIT:</strong> I realized that my earlier response was highly misleading, which was thankfully pointed out by @xdurch0 and @Timbus Calin. Here is an edited answer.</p>

<ol>
<li><p>Check that all your input values are valid. Are there any <code>nan</code> or <code>inf</code> values in your training data?</p></li>
<li><p>Try using different activation functions. <code>ReLU</code> is good, but it is prone to what is known as the <a href="https://arxiv.org/abs/1903.06733" rel="nofollow noreferrer">dying ReLu problem</a>, where the neural network basically learns nothing since no updates are made to its weight. One possibility is to use <a href="https://keras.io/layers/advanced-activations/" rel="nofollow noreferrer">Leaky ReLu or PReLU</a>. </p></li>
<li><p>Try using gradient clipping, which is a technique used to tackle vanishing or exploding gradients (which is likely what is happening in your case). <a href="https://keras.io/optimizers/" rel="nofollow noreferrer">Keras</a> allows users to configure <code>clipnorm</code> <code>clip value</code> for optimizers. </p></li>
</ol>

<p>There are posts on SO that report similar problems, such as <a href="https://stackoverflow.com/questions/37232782/nan-loss-when-training-regression-network">this one</a>, which might also be of interest to you.</p>
Keras Neural Network Accuracy is always 0 While Training
<p>I'm making a simple classification algo with a keras neural network. The goal is to take 3 data points on weather and decide whether or not there's a wildfire. Here's an image of the .csv dataset that I'm using to train the model(this image is only the top few lines and isn't the entire thing ):
<a href="https://i.stack.imgur.com/cPyti.png" rel="nofollow noreferrer">wildfire weather dataset</a>
As you can see, there are 4 columns with the fourth being either a "1" which means "fire", or a "0" which means "no fire". I want the algo to predict either a 1 or a 0. This is the code that I wrote:</p>

<pre><code>import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import keras
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import Dropout
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
import csv


#THIS IS USED TO TRAIN THE MODEL
# Importing the dataset
dataset = pd.read_csv('Fire_Weather.csv')
dataset.head()

X=dataset.iloc[:,0:3]
Y=dataset.iloc[:,3]

X.head()
obj=StandardScaler()
X=obj.fit_transform(X)

X_train,X_test,y_train,y_test=train_test_split(X, Y, test_size=0.25)


print(X_train.shape)
print(X_test.shape)
print(y_train.shape)
print(y_test.shape)


classifier = Sequential()

    # Adding the input layer and the first hidden layer
classifier.add(Dense(units = 6, kernel_initializer = 'uniform', activation = 
                                                      'relu', input_dim = 3))
   # classifier.add(Dropout(p = 0.1))

   # Adding the second hidden layer
classifier.add(Dense(units = 6, kernel_initializer = 'uniform', activation 
                                                                   = 'relu'))
   # classifier.add(Dropout(p = 0.1))

   # Adding the output layer
classifier.add(Dense(units = 1, kernel_initializer = 'uniform', activation 
                                                               = 'sigmoid'))

       # Compiling the ANN
classifier.compile(optimizer = 'adam', loss = 'binary_crossentropy', metrics 
                                                          = ['accuracy'])

classifier.fit(X_train, y_train, batch_size = 3, epochs = 10)
y_pred = classifier.predict(X_test)
y_pred = (y_pred &gt; 0.5)
print(y_pred)

classifier.save("weather_model.h5")
</code></pre>

<p>The problem is that whenever I run this, my accuracy is always "0.0000e+00" and my training output looks like this:</p>

<pre><code>    Epoch 1/10
2146/2146 [==============================] - 2s 758us/step - loss: nan - accuracy: 0.0238
Epoch 2/10
2146/2146 [==============================] - 1s 625us/step - loss: nan - accuracy: 0.0000e+00
Epoch 3/10
2146/2146 [==============================] - 1s 604us/step - loss: nan - accuracy: 0.0000e+00
Epoch 4/10
2146/2146 [==============================] - 1s 609us/step - loss: nan - accuracy: 0.0000e+00
Epoch 5/10
2146/2146 [==============================] - 1s 624us/step - loss: nan - accuracy: 0.0000e+00
Epoch 6/10
2146/2146 [==============================] - 1s 633us/step - loss: nan - accuracy: 0.0000e+00
Epoch 7/10
2146/2146 [==============================] - 1s 481us/step - loss: nan - accuracy: 0.0000e+00
Epoch 8/10
2146/2146 [==============================] - 1s 476us/step - loss: nan - accuracy: 0.0000e+00
Epoch 9/10
2146/2146 [==============================] - 1s 474us/step - loss: nan - accuracy: 0.0000e+00
Epoch 10/10
2146/2146 [==============================] - 1s 474us/step - loss: nan - accuracy: 0.0000e+00
</code></pre>

<p>Does anyone know why this is happening and what I could do to my code to fix this? 
Thank You!</p>