diff --git a/hebel/layers/logistic_layer.py b/hebel/layers/logistic_layer.py
index <HASH>..<HASH> 100644
--- a/hebel/layers/logistic_layer.py
+++ b/hebel/layers/logistic_layer.py
@@ -289,6 +289,7 @@ class LogisticLayer(TopLayer):
         loss = cross_entropy_logistic(activations, targets)
 
         if average: loss /= targets.shape[0]
+        assert np.isfinite(loss)
         return loss
         
     train_error = cross_entropy_error
@@ -308,4 +309,5 @@ class LogisticLayer(TopLayer):
         class_error = np.sum((activations.get() >= .5) != (targets >= .5))
 
         if average: class_error = float(class_error) / targets.shape[0]
+        assert np.isfinite(class_error)
         return class_error
diff --git a/hebel/models/neural_net.py b/hebel/models/neural_net.py
index <HASH>..<HASH> 100644
--- a/hebel/models/neural_net.py
+++ b/hebel/models/neural_net.py
@@ -322,6 +322,8 @@ class NeuralNet(Model):
         loss, hidden_cache, logistic_cache = self.evaluate(
             input_data, targets, return_cache=True, prediction=False)
 
+        assert np.isfinite(loss)
+
         # Backpropagation
         if self.hidden_layers:
             hidden_activations = hidden_cache[-1][0]
Assert that loss is not nan