VTA on ultra96 - ModuleNotFoundError: No module named 'pynq'


I am having some issues just running ‘vta/tests/python/integration/test_benchmark_topi_conv2d.py’ after setup.

I am using an Ultra96-V2 FPGA.

  1. I followed guide ‘VTA Installation Guide — tvm 0.9.dev182+ge718f5a8a documentation
  2. Setup ‘vta_config.json’ targetting ultra96,
  3. Launched ‘sudo ./apps/vta_rpc/start_rpc_server.sh’ on Target
  4. Set VTA_RPC_HOST and VTA_RPC_PORT with proper values
  5. launching ‘vta/tests/python/integration/test_benchmark_topi_conv2d.py’ on HOST.

the ‘test_conv2d(device=“arm_cpu”)’ runs fine, with fails at ‘test_conv2d(device=“vta”)’ :

RPCError: Error caught from RPC call: ModuleNotFoundError: No module named ‘pynq’

it seems like the target cannot impot pynq : error here → ‘from pynq import Bitstream’

But when using python terminal on the Target’s notebook, I can import pynq properly and it is list in the pynq-env

I have no idea what I’m doing wrong. I figured maybe somebody here can help me out!

Thank you

1 Like

Hello @plt8

I had the same problem and creating the pip install pynq==2.5.4 helped to manage it

The best way is to create python virtual environment on the Target, install pynq into venv, and then run RPC sever under this venv

We should use pynq==2.5.4 because there are some deprecated symbols from v2.6.0 (e.g Removed Xlnk allocator), but they are still using in the TVM RPC

BR, Arina

Hello, Thank you so much for your response.

  1. I created a venv and then activated it
  2. started RPC, then:
  • used: ./apps/vta_rpc/start_rpc_server.sh
  • not: python -m tvm.exec.rpc_server --host --port=9091
  1. Lauchned from host: python3 ./vta/tests/python/integration/test_benchmark_topi_conv2d.py
  2. Same issue (see screenshot below)

Host error:

I don’t understand how the target cannot find module pynq

Maybe i’ll try with Pynq image 2.5, (I currently have Ultra96-v2 2.7 here )

Actually, it looks like it can now find the module for some reason, but I current have the issue here:

It turns out I was able to make it work using PYNQ image version 2.5

Hello,i got the same error,but when i used pip install pynq==2.5.4,i got the error:

,do you meet it when you fix your error?