fastmachinelearning / hls4ml-tutorial

Tutorial notebooks for hls4ml
http://fastmachinelearning.org/hls4ml-tutorial/
274 stars 123 forks source link

Part7b Deployment failing #58

Open obsidian-1 opened 10 months ago

obsidian-1 commented 10 months ago

nn = NeuralNetworkOverlay('hls4ml_nn.bit', X_test.shape, y_test.shape) The above function fails with the error:

`--------------------------------------------------------------------------- error Traceback (most recent call last)

in () ----> 1 nn = NeuralNetworkOverlay('hls4ml_nn.bit', X_test.shape, y_test.shape) /home/xilinx/jupyter_notebooks/package/axi_stream_driver.py in __init__(self, bitfile_name, x_shape, y_shape, dtype, dtbo, download, ignore_version, device) 9 self, bitfile_name, x_shape, y_shape, dtype=np.float32, dtbo=None, download=True, ignore_version=False, device=None 10 ): ---> 11 super().__init__(bitfile_name, dtbo=None, download=True, ignore_version=False, device=None) 12 self.sendchannel = self.hier_0.axi_dma_0.sendchannel 13 self.recvchannel = self.hier_0.axi_dma_0.recvchannel /usr/local/lib/python3.6/dist-packages/pynq/overlay.py in __init__(self, bitfile_name, dtbo, download, ignore_version, device) 323 324 if download: --> 325 self.download() 326 327 self.__doc__ = _build_docstring(self._ip_map._description, /usr/local/lib/python3.6/dist-packages/pynq/overlay.py in download(self, dtbo) 372 Clocks.set_pl_clk(i) 373 --> 374 super().download(self.parser) 375 if dtbo: 376 super().insert_dtbo(dtbo) /usr/local/lib/python3.6/dist-packages/pynq/bitstream.py in download(self, parser) 141 142 """ --> 143 self.device.download(self, parser) 144 145 def remove_dtbo(self): /usr/local/lib/python3.6/dist-packages/pynq/pl_server/device.py in download(self, bitstream, parser) 568 def download(self, bitstream, parser=None): 569 if not bitstream.binfile_name: --> 570 _preload_binfile(bitstream) 571 572 if not bitstream.partial: /usr/local/lib/python3.6/dist-packages/pynq/pl_server/device.py in _preload_binfile(bitstream) 507 bitstream.firmware_path = os.path.join('/lib/firmware', 508 bitstream.binfile_name) --> 509 bit_dict = parse_bit_header(bitstream.bitfile_name) 510 if bit_dict != bitstream.bit_data: 511 bitstream.bit_data = bit_dict /usr/local/lib/python3.6/dist-packages/pynq/pl_server/device.py in parse_bit_header(bitfile) 457 458 # Strip the (2+n)-byte first field (2-bit length, n-bit data) --> 459 length = struct.unpack('>h', contents[offset:offset + 2])[0] 460 offset += 2 + length 461 error: unpack requires a buffer of 2 bytes` My device is the Pynq-z2 board running the 4.19.0-xilinx-v2019.1 kernel Compiled on host using vivado 2019.2 on Ubuntu 20.04.1.