diff --git a/src/Modules/General/spark.py b/src/Modules/General/spark.py
index f57c6a39b223331c1f14e2185a95ce999fed5573..273237aa1cb0fe59660325244cfbc3f7014f3c33 100755
--- a/src/Modules/General/spark.py
+++ b/src/Modules/General/spark.py
@@ -36,6 +36,12 @@ class spark(sparkOp):
             LN = data["L:N"]
             LN = loads(dumps(LN))
             self.g.Layer_Neuron = LN
+
+            try:
+                self.g.InputPerEpoch = data["E"]
+            except Exception:
+                self.g.InputPerEpoch = pymongo.collection.Collection(self.g.db, 'labels').count_documents({})
+                pass
             for l in LN:
                 if(l == "Input"):
                     self.g.Input = LN[l]
@@ -68,7 +74,6 @@ class spark(sparkOp):
                     self.g.labelsExistance = True
                     M = max(M, pymongo.collection.Collection(
                         self.g.db, 'labels').find_one(sort=[("T", -1)])["T"])
-                    self.g.InputPerEpoch = pymongo.collection.Collection(self.g.db, 'labels').count_documents({})
                 else:
                     print("No labels")