diff --git a/part6_cnns.ipynb b/part6_cnns.ipynb index 6a78f0a8..04e2236f 100644 --- a/part6_cnns.ipynb +++ b/part6_cnns.ipynb @@ -737,19 +737,13 @@ "source": [ "# Then the QKeras model\n", "hls_config_q = hls4ml.utils.config_from_keras_model(qmodel, granularity='name', backend='Vitis')\n", - "hls_config_q['Model']['ReuseFactor'] = 1\n", - "hls_config['Model']['Precision'] = 'ap_fixed<16,6>'\n", - "hls_config_q['LayerName']['output_softmax']['Strategy'] = 'Stable'\n", + "\n", "plotting.print_dict(hls_config_q)\n", "\n", - "cfg_q = hls4ml.converters.create_config(backend='Vitis')\n", - "cfg_q['IOType'] = 'io_stream' # Must set this if using CNNs!\n", - "cfg_q['HLSConfig'] = hls_config_q\n", - "cfg_q['KerasModel'] = qmodel\n", - "cfg_q['OutputDir'] = 'quantized_pruned_cnn/'\n", - "cfg_q['XilinxPart'] = 'xcu250-figd2104-2L-e'\n", + "hls_model_q = hls4ml.converters.convert_from_keras_model(\n", + " qmodel, hls_config=hls_config_q, output_dir='quantized_pruned_cnn', backend='Vitis', io_type='io_stream'\n", + ")\n", "\n", - "hls_model_q = hls4ml.converters.keras_to_hls(cfg_q)\n", "hls_model_q.compile()" ] }, @@ -1321,7 +1315,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.11" + "version": "3.11.9" } }, "nbformat": 4,