From 541c86f16f7c5eb26a528db53885f96cd89782c5 Mon Sep 17 00:00:00 2001
From: Nathan Zhao <nz11@tyler.cs.illinois.edu>
Date: Sun, 31 Jan 2021 18:57:00 -0600
Subject: [PATCH] update expected accuracy, fix frontend causing mobilenet
 problem

---
 hpvm/projects/keras/README.md                | 19 ++-----------------
 hpvm/projects/keras/frontend/weight_utils.py | 10 +++++++---
 2 files changed, 9 insertions(+), 20 deletions(-)

diff --git a/hpvm/projects/keras/README.md b/hpvm/projects/keras/README.md
index f96a0afa01..638657a064 100644
--- a/hpvm/projects/keras/README.md
+++ b/hpvm/projects/keras/README.md
@@ -2,21 +2,6 @@
 
 ## Installing Dependencies
 
-### Updating pip
-The pip version required in this subproject must be >= `19.3`.
-
-To upgrade pip:
-
-```
-pip install --upgrade pip
-```
-
-To check installed pip version:
-
-```
-pip -V
-```
-
 ### Importing Conda Environment:
 
 ```
@@ -55,11 +40,11 @@ List of benchmarks and the expected accuracies:
 | ResNet50-ImageNet | 74.50 |
 | VGG16-CIFAR10 | 89.42 |
 | VGG16-CIFAR100 | 66.20 |
-| VGG16-ImageNet | 72.50 |
+| VGG16-ImageNet | 72.50 | todo: fix broken
 
 Activate conda environment (above) before running benchmarks 
 
-### Synopsis
+### Synopsys
 
 ```
 python src/${BENCH_NAME}.py  [hpvm_reload|keras_reload]  [frontend] 
diff --git a/hpvm/projects/keras/frontend/weight_utils.py b/hpvm/projects/keras/frontend/weight_utils.py
index 18ceb433c6..83a13c8135 100644
--- a/hpvm/projects/keras/frontend/weight_utils.py
+++ b/hpvm/projects/keras/frontend/weight_utils.py
@@ -151,8 +151,9 @@ def reloadHPVMWeights(model, reload_dir, output_model):
         #-- print ("** w_path = ", w_path)    
         w_arr = np.fromfile(w_path, dtype='float32')
 
-        b_path = reload_dir + layer_name + "_b.bin"
-        b_arr = np.fromfile(b_path, dtype='float32')
+        if layer.use_bias:
+            b_path = reload_dir + layer_name + "_b.bin"
+            b_arr = np.fromfile(b_path, dtype='float32')
 
         w_shape = layer.get_weights()[0].shape    
         if "conv" in layer_name:      
@@ -163,7 +164,10 @@ def reloadHPVMWeights(model, reload_dir, output_model):
         if "dense" in layer_name:      
           w_arr = np.reshape(w_arr, w_shape)
 
-        weights = [w_arr, b_arr]
+        if layer.use_bias:
+            weights = [w_arr, b_arr]
+        else:
+            weights = [w_arr]
         
         layer.set_weights(weights)
         
-- 
GitLab