|
11 | 11 | }, |
12 | 12 | { |
13 | 13 | "cell_type": "code", |
14 | | - "execution_count": 1, |
| 14 | + "execution_count": null, |
15 | 15 | "metadata": {}, |
16 | | - "outputs": [ |
17 | | - { |
18 | | - "name": "stderr", |
19 | | - "output_type": "stream", |
20 | | - "text": [ |
21 | | - "2024-05-16 06:16:51.322811: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: SSE4.1 SSE4.2 AVX AVX2 FMA\n", |
22 | | - "To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.\n" |
23 | | - ] |
24 | | - } |
25 | | - ], |
| 16 | + "outputs": [], |
26 | 17 | "source": [ |
27 | 18 | "from tensorflow.keras.models import load_model\n", |
28 | 19 | "from qkeras.utils import _add_supported_quantized_objects\n", |
|
44 | 35 | }, |
45 | 36 | { |
46 | 37 | "cell_type": "code", |
47 | | - "execution_count": 2, |
| 38 | + "execution_count": null, |
48 | 39 | "metadata": {}, |
49 | | - "outputs": [ |
50 | | - { |
51 | | - "name": "stderr", |
52 | | - "output_type": "stream", |
53 | | - "text": [ |
54 | | - "2024-05-16 06:16:59.043487: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: SSE4.1 SSE4.2 AVX AVX2 FMA\n", |
55 | | - "To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.\n" |
56 | | - ] |
57 | | - }, |
58 | | - { |
59 | | - "name": "stdout", |
60 | | - "output_type": "stream", |
61 | | - "text": [ |
62 | | - "WARNING:tensorflow:From /opt/conda/lib/python3.10/site-packages/tensorflow/python/autograph/pyct/static_analysis/liveness.py:83: Analyzer.lamba_check (from tensorflow.python.autograph.pyct.static_analysis.liveness) is deprecated and will be removed after 2023-09-23.\n", |
63 | | - "Instructions for updating:\n", |
64 | | - "Lambda fuctions will be no more assumed to be used in the statement where they are used, or at least in the same block. https://github.com/tensorflow/tensorflow/issues/56089\n" |
65 | | - ] |
66 | | - }, |
67 | | - { |
68 | | - "name": "stderr", |
69 | | - "output_type": "stream", |
70 | | - "text": [ |
71 | | - "WARNING:tensorflow:From /opt/conda/lib/python3.10/site-packages/tensorflow/python/autograph/pyct/static_analysis/liveness.py:83: Analyzer.lamba_check (from tensorflow.python.autograph.pyct.static_analysis.liveness) is deprecated and will be removed after 2023-09-23.\n", |
72 | | - "Instructions for updating:\n", |
73 | | - "Lambda fuctions will be no more assumed to be used in the statement where they are used, or at least in the same block. https://github.com/tensorflow/tensorflow/issues/56089\n" |
74 | | - ] |
75 | | - }, |
76 | | - { |
77 | | - "name": "stdout", |
78 | | - "output_type": "stream", |
79 | | - "text": [ |
80 | | - "WARNING:tensorflow:No training configuration found in the save file, so the model was *not* compiled. Compile it manually.\n" |
81 | | - ] |
82 | | - }, |
83 | | - { |
84 | | - "name": "stderr", |
85 | | - "output_type": "stream", |
86 | | - "text": [ |
87 | | - "WARNING:tensorflow:No training configuration found in the save file, so the model was *not* compiled. Compile it manually.\n" |
88 | | - ] |
89 | | - } |
90 | | - ], |
| 40 | + "outputs": [], |
91 | 41 | "source": [ |
92 | 42 | "model = load_model('model_3/KERAS_check_best_model.h5', custom_objects=co)" |
93 | 43 | ] |
|
102 | 52 | }, |
103 | 53 | { |
104 | 54 | "cell_type": "code", |
105 | | - "execution_count": 5, |
| 55 | + "execution_count": null, |
106 | 56 | "metadata": {}, |
107 | | - "outputs": [ |
108 | | - { |
109 | | - "name": "stdout", |
110 | | - "output_type": "stream", |
111 | | - "text": [ |
112 | | - "Interpreting Sequential\n", |
113 | | - "Topology:\n", |
114 | | - "Layer name: fc1_input, layer type: InputLayer, input shapes: [[None, 16]], output shape: [None, 16]\n", |
115 | | - "Layer name: fc1, layer type: QDense, input shapes: [[None, 16]], output shape: [None, 64]\n", |
116 | | - "Layer name: relu1, layer type: Activation, input shapes: [[None, 64]], output shape: [None, 64]\n", |
117 | | - "Layer name: fc2, layer type: QDense, input shapes: [[None, 64]], output shape: [None, 32]\n", |
118 | | - "Layer name: relu2, layer type: Activation, input shapes: [[None, 32]], output shape: [None, 32]\n", |
119 | | - "Layer name: fc3, layer type: QDense, input shapes: [[None, 32]], output shape: [None, 32]\n", |
120 | | - "Layer name: relu3, layer type: Activation, input shapes: [[None, 32]], output shape: [None, 32]\n", |
121 | | - "Layer name: output, layer type: QDense, input shapes: [[None, 32]], output shape: [None, 5]\n", |
122 | | - "Layer name: softmax, layer type: Softmax, input shapes: [[None, 5]], output shape: [None, 5]\n", |
123 | | - "-----------------------------------\n", |
124 | | - "Model\n", |
125 | | - " Precision: fixed<16,6>\n", |
126 | | - " ReuseFactor: 1\n", |
127 | | - " Strategy: Latency\n", |
128 | | - " BramFactor: 1000000000\n", |
129 | | - " TraceOutput: False\n", |
130 | | - "LayerName\n", |
131 | | - " fc1_input\n", |
132 | | - " Trace: False\n", |
133 | | - " Precision\n", |
134 | | - " result: fixed<16,6>\n", |
135 | | - " fc1\n", |
136 | | - " Trace: False\n", |
137 | | - " Precision\n", |
138 | | - " result: fixed<16,6>\n", |
139 | | - " weight: fixed<6,1,TRN,WRAP,0>\n", |
140 | | - " bias: fixed<6,1,TRN,WRAP,0>\n", |
141 | | - " fc1_linear\n", |
142 | | - " Trace: False\n", |
143 | | - " Precision\n", |
144 | | - " result: fixed<16,6>\n", |
145 | | - " relu1\n", |
146 | | - " Trace: False\n", |
147 | | - " Precision\n", |
148 | | - " result: ufixed<6,0,RND_CONV,SAT,0>\n", |
149 | | - " fc2\n", |
150 | | - " Trace: False\n", |
151 | | - " Precision\n", |
152 | | - " result: fixed<16,6>\n", |
153 | | - " weight: fixed<6,1,TRN,WRAP,0>\n", |
154 | | - " bias: fixed<6,1,TRN,WRAP,0>\n", |
155 | | - " fc2_linear\n", |
156 | | - " Trace: False\n", |
157 | | - " Precision\n", |
158 | | - " result: fixed<16,6>\n", |
159 | | - " relu2\n", |
160 | | - " Trace: False\n", |
161 | | - " Precision\n", |
162 | | - " result: ufixed<6,0,RND_CONV,SAT,0>\n", |
163 | | - " fc3\n", |
164 | | - " Trace: False\n", |
165 | | - " Precision\n", |
166 | | - " result: fixed<16,6>\n", |
167 | | - " weight: fixed<6,1,TRN,WRAP,0>\n", |
168 | | - " bias: fixed<6,1,TRN,WRAP,0>\n", |
169 | | - " fc3_linear\n", |
170 | | - " Trace: False\n", |
171 | | - " Precision\n", |
172 | | - " result: fixed<16,6>\n", |
173 | | - " relu3\n", |
174 | | - " Trace: False\n", |
175 | | - " Precision\n", |
176 | | - " result: ufixed<6,0,RND_CONV,SAT,0>\n", |
177 | | - " output\n", |
178 | | - " Trace: False\n", |
179 | | - " Precision\n", |
180 | | - " result: fixed<16,6>\n", |
181 | | - " weight: fixed<6,1,TRN,WRAP,0>\n", |
182 | | - " bias: fixed<6,1,TRN,WRAP,0>\n", |
183 | | - " output_linear\n", |
184 | | - " Trace: False\n", |
185 | | - " Precision\n", |
186 | | - " result: fixed<16,6>\n", |
187 | | - " softmax\n", |
188 | | - " Trace: False\n", |
189 | | - " Precision\n", |
190 | | - " result: fixed<16,6>\n", |
191 | | - " exp_table_t: ap_fixed<18,8>\n", |
192 | | - " inv_table_t: ap_fixed<18,4>\n", |
193 | | - "-----------------------------------\n", |
194 | | - "Interpreting Sequential\n", |
195 | | - "Topology:\n", |
196 | | - "Layer name: fc1_input, layer type: InputLayer, input shapes: [[None, 16]], output shape: [None, 16]\n", |
197 | | - "Layer name: fc1, layer type: QDense, input shapes: [[None, 16]], output shape: [None, 64]\n", |
198 | | - "Layer name: relu1, layer type: Activation, input shapes: [[None, 64]], output shape: [None, 64]\n", |
199 | | - "Layer name: fc2, layer type: QDense, input shapes: [[None, 64]], output shape: [None, 32]\n", |
200 | | - "Layer name: relu2, layer type: Activation, input shapes: [[None, 32]], output shape: [None, 32]\n", |
201 | | - "Layer name: fc3, layer type: QDense, input shapes: [[None, 32]], output shape: [None, 32]\n", |
202 | | - "Layer name: relu3, layer type: Activation, input shapes: [[None, 32]], output shape: [None, 32]\n", |
203 | | - "Layer name: output, layer type: QDense, input shapes: [[None, 32]], output shape: [None, 5]\n", |
204 | | - "Layer name: softmax, layer type: Softmax, input shapes: [[None, 5]], output shape: [None, 5]\n", |
205 | | - "Creating HLS model\n", |
206 | | - "Writing HLS project\n", |
207 | | - "WARNING:tensorflow:Compiled the loaded model, but the compiled metrics have yet to be built. `model.compile_metrics` will be empty until you train or evaluate the model.\n" |
208 | | - ] |
209 | | - }, |
210 | | - { |
211 | | - "name": "stderr", |
212 | | - "output_type": "stream", |
213 | | - "text": [ |
214 | | - "WARNING:tensorflow:Compiled the loaded model, but the compiled metrics have yet to be built. `model.compile_metrics` will be empty until you train or evaluate the model.\n" |
215 | | - ] |
216 | | - }, |
217 | | - { |
218 | | - "name": "stdout", |
219 | | - "output_type": "stream", |
220 | | - "text": [ |
221 | | - "Done\n", |
222 | | - "\n", |
223 | | - "\n", |
224 | | - "Writing Accelerator code\n", |
225 | | - "WARNING: You set a Part that does not correspond to the Board you specified.The correct Part is now set.\n", |
226 | | - "Done\n" |
227 | | - ] |
228 | | - } |
229 | | - ], |
| 57 | + "outputs": [], |
230 | 58 | "source": [ |
231 | 59 | "import sys\n", |
232 | 60 | "import os\n", |
|
271 | 99 | }, |
272 | 100 | { |
273 | 101 | "cell_type": "code", |
274 | | - "execution_count": 6, |
| 102 | + "execution_count": null, |
275 | 103 | "metadata": {}, |
276 | | - "outputs": [ |
277 | | - { |
278 | | - "name": "stdout", |
279 | | - "output_type": "stream", |
280 | | - "text": [ |
281 | | - "Part: xcvu13p-flga2577-2-e\n", |
282 | | - "ClockPeriod: 5\n", |
283 | | - "IOType: io_parallel\n", |
284 | | - "HLSConfig\n", |
285 | | - "AcceleratorConfig\n", |
286 | | - " Board: alveo-u55c\n", |
287 | | - " Num_Kernel: 1\n", |
288 | | - " Num_Thread: 1\n", |
289 | | - " Batchsize: 8192\n" |
290 | | - ] |
291 | | - } |
292 | | - ], |
| 104 | + "outputs": [], |
293 | 105 | "source": [ |
294 | 106 | "plotting.print_dict(hls4ml.backends.get_backend('VitisAccelerator').create_initial_config())" |
295 | 107 | ] |
|
0 commit comments