Skip to content

Commit add74b3

Browse files
committed
update qkeras setup
1 parent 2ed46d7 commit add74b3

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

part6_cnns.ipynb

+5-11
Original file line numberDiff line numberDiff line change
@@ -737,19 +737,13 @@
737737
"source": [
738738
"# Then the QKeras model\n",
739739
"hls_config_q = hls4ml.utils.config_from_keras_model(qmodel, granularity='name', backend='Vitis')\n",
740-
"hls_config_q['Model']['ReuseFactor'] = 1\n",
741-
"hls_config['Model']['Precision'] = 'ap_fixed<16,6>'\n",
742-
"hls_config_q['LayerName']['output_softmax']['Strategy'] = 'Stable'\n",
740+
"\n",
743741
"plotting.print_dict(hls_config_q)\n",
744742
"\n",
745-
"cfg_q = hls4ml.converters.create_config(backend='Vitis')\n",
746-
"cfg_q['IOType'] = 'io_stream' # Must set this if using CNNs!\n",
747-
"cfg_q['HLSConfig'] = hls_config_q\n",
748-
"cfg_q['KerasModel'] = qmodel\n",
749-
"cfg_q['OutputDir'] = 'quantized_pruned_cnn/'\n",
750-
"cfg_q['XilinxPart'] = 'xcu250-figd2104-2L-e'\n",
743+
"hls_model_q = hls4ml.converters.convert_from_keras_model(\n",
744+
" qmodel, hls_config=hls_config_q, output_dir='quantized_pruned_cnn', backend='Vitis', io_type='io_stream'\n",
745+
")\n",
751746
"\n",
752-
"hls_model_q = hls4ml.converters.keras_to_hls(cfg_q)\n",
753747
"hls_model_q.compile()"
754748
]
755749
},
@@ -1321,7 +1315,7 @@
13211315
"name": "python",
13221316
"nbconvert_exporter": "python",
13231317
"pygments_lexer": "ipython3",
1324-
"version": "3.11.11"
1318+
"version": "3.11.9"
13251319
}
13261320
},
13271321
"nbformat": 4,

0 commit comments

Comments
 (0)