From a3f227f1fb947976bc86405d41db909219216c35 Mon Sep 17 00:00:00 2001
From: Hashim Sharif <hsharif3@miranda.cs.illinois.edu>
Date: Tue, 23 Mar 2021 20:16:57 -0500
Subject: [PATCH] Fixing directory creation bug in Keras frontend

---
 .../keras/keras_frontend/approxhpvm_translator.py     | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/hpvm/projects/keras/keras_frontend/approxhpvm_translator.py b/hpvm/projects/keras/keras_frontend/approxhpvm_translator.py
index a9e17a4eb8..2464710750 100644
--- a/hpvm/projects/keras/keras_frontend/approxhpvm_translator.py
+++ b/hpvm/projects/keras/keras_frontend/approxhpvm_translator.py
@@ -1084,14 +1084,19 @@ def getUniquePath(weights_dir):
 def createRecursiveDir(target_dir):
 
   if os.path.exists(target_dir):
-    print ("Directory = ", target_dir, " exists. Aborting....")
+    print ("Directory = ", target_dir, " exists ")
+    print ("Delete Directory or Give Different Path. Aborting....")
     sys.exit(1)
+
+  print (target_dir)
   
   toks = target_dir.split("/")
+  print (toks)
   for i in range(len(toks)):
     path_str = "/".join(toks[0:i+1])
-    if not os.path.exists(path_str):
-      os.mkdir(path_str)
+    if path_str != "":
+      if not os.path.exists(path_str):
+        os.mkdir(path_str)
   
 
 
-- 
GitLab