diff --git a/hpvm/projects/keras/README.md b/hpvm/projects/keras/README.md index f96a0afa0161a849c7cf6a8e0f07bd8a59a76b26..638657a064a9f97fc448c40ed43c2eb51c5b89d8 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 18ceb433c69e749da1fbc06affa0d3388eb3c76a..83a13c81351bf621a5f7be41ebe8f67bfdf6c3d4 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)