diff --git a/part6_cnns.ipynb b/part6_cnns.ipynb index 7beb4bb..4a8bda6 100644 --- a/part6_cnns.ipynb +++ b/part6_cnns.ipynb @@ -38,6 +38,7 @@ "metadata": {}, "outputs": [], "source": [ + "import os\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "import time\n", @@ -645,10 +646,10 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Now, we need to define the hls4ml and Vivado configurations. Two things will change with respect to what was done in the previous exercises. First, we will use ``IOType= 'io_stream'`` in the Vivado configuration.\n", + "Now, we need to define the hls4ml and Vivado configurations. Two things will change with respect to what was done in the previous exercises. First, we will use ``io_type='io_stream'`` in the Vitis_HLS configuration.\n", "\n", "---\n", - "****You must use ``IOType= 'io_stream'`` if attempting to synthesize a large convolutional neural network.****\n", + "****You must use ``io_type='io_stream'`` if attempting to synthesize a large convolutional neural network.****\n", "\n", "---\n", "The CNN implementation in hls4ml is based on streams, which are synthesized in hardware as first in, first out (FIFO) buffers. Shift registers are used to keep track of the last ```` rows of input pixels, and maintains a shifting snapshot of the convolution kernel.\n", @@ -678,10 +679,12 @@ "\n", "\n", "hls_model = hls4ml.converters.convert_from_keras_model(\n", - " model, hls_config=hls_config, backend='Vitis', output_dir='model_1/hls4ml_prj', part='xcu250-figd2104-2L-e'\n", - ")\n", - "hls_model = hls4ml.converters.keras_to_hls(\n", - " model, config=hls_config, output_dir='pruned_cnn', backend='Vitis', part='xcu250-figd2104-2L-e', io_type='io_stream'\n", + " model,\n", + " hls_config=hls_config,\n", + " backend='Vitis',\n", + " output_dir='model_1/hls4ml_prj',\n", + " part='xcu250-figd2104-2L-e',\n", + " io_type='io_stream',\n", ")\n", "hls_model.compile()" ] @@ -878,10 +881,6 @@ "metadata": {}, "outputs": [], "source": [ - "import os\n", - "\n", - "os.environ['PATH'] = '/opt/Xilinx//Vitis_HLS/2024.1/bin:' + os.environ['PATH']\n", - "\n", "synth = False # Only if you want to synthesize the models yourself (>1h per model) rather than look at the provided reports.\n", "if synth:\n", " hls_model.build(csim=False, synth=True, vsynth=True)\n", @@ -1320,7 +1319,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.16" + "version": "3.11.11" } }, "nbformat": 4,