AttributeError: 'ContiguousArray' object has no attribute 'cacheable'

AttributeError Traceback (most recent call last)
in ()
4 for i in range (IMG_NUM):
5 t0 = time.time()
----> 6 dma.sendchannel.transfer(test_images[index[i]]) # 调用DMA将待预测图片数据传输到IP核
7 dma.recvchannel.transfer(out_buf[index[i]]) # 调用DMA从IP核获取RNN的推导结果
8 dma.sendchannel.wait() # 等待DMA发送完成

/usr/local/lib/python3.6/dist-packages/pynq/lib/dma.py in transfer(self, array)
122 raise RuntimeError(‘DMA channel not idle’)
123 if self._flush_before:
→ 124 array.flush()
125 self._mmio.write(self._offset + 0x18, array.physical_address)
126 self._mmio.write(self._offset + 0x28, array.nbytes)

/usr/local/lib/python3.6/dist-packages/pynq/xlnk.py in flush(self)
99
100 “”"
→ 101 if self.cacheable:
102 Xlnk.libxlnk.cma_flush_cache(self.pointer, self.physical_address, self.nbytes)
103

AttributeError: ‘ContiguousArray’ object has no attribute ‘cacheable’

I’m using jupyterbook for mnist handwritten digit recognition error, I’m using vivado 2018.3 and 2.4 like pynq image, I don’t know if it’s because of a version issue

Can you upgrade to the latest PYNQ version? v2.4 is quite old.
Is this your own design or is it an example you are following? Can you post more of your code and which board you are using?

Cathal

I’m using a board from zynq, the ALINX Black Gold series. I didn’t find the latest version, so I used a 2.6 image. I’m doing an example of an FPGA-accelerated neural network. Older versions of the code always seem to have a lot of bugs. Here is the full jupyter code.
I fixed the previous one, but I got a new one.
AttributeError Traceback (most recent call last)
in ()
7 in_buf[i]=test_images[index[i]]
8 dma.sendchannel.transfer(in_buf) # 调用DMA将待预测图片数据传输到IP核
----> 9 dma.recvchannel.transfer(out_buf[index[i]]) # 调用DMA从IP核获取RNN的推导结果
10 dma.sendchannel.wait() # 等待DMA发送完成
11 dma.recvchannel.wait() # 等待DMA接收完成

/usr/local/lib/python3.6/dist-packages/pynq/lib/dma.py in transfer(self, array)
123 if self._flush_before:
124 array.flush()
→ 125 self._mmio.write(self._offset + 0x18, array.physical_address)
126 self._mmio.write(self._offset + 0x28, array.nbytes)
127 self._active_buffer = array

AttributeError: ‘ContiguousArray’ object has no attribute ‘physical_address’

mnist_lstm.ipynb (15.0 KB)