Add default if no normal/abnormal model is found
@@ -411,10 +411,17 @@ if __name__ == '__main__':
else:
rnnpath = "/models/rnnmodel.ckpt"
+ try:
rnnmodel.load(rnnpath)
+ abnormal_model = True
+ except:
+ abnormal_model = False
+ abnormality = 0
+
scores = []
max_key = None
max_score = 0
+ if abnormal_model is True:
# Group input sessions by number of packets
inputs_by_length = [[] for i in range(8)]
labels_by_length = [[] for i in range(8)]
