Xilinx / BNN-PYNQ

Quantized Neural Networks (QNNs) on PYNQ
https://xilinx.github.io/finn/
BSD 3-Clause "New" or "Revised" License
671 stars 306 forks source link

set up question #35

Closed zzeng00 closed 6 years ago

zzeng00 commented 6 years ago

Hello, I am now trying to set up this BNN project on my PYNQ-Z1, but I meet some issues. Since I am not allowed to connect my PYNQ to Network Router in my university, I connect it directly to my computer. So I could not use "sudo pip3.6 install git+https://github.com/Xilinx/BNN-PYNQ.git" to install this package to my board. What I did was download the whole BNN-PYNQ, extract it and copy to \192.168.2.99\xilinx., I added the VIVADO-HLS include under \192.168.2.99\xilinx\BNN-PYNQ-master\bnn, then I added one line in the setup.py:"os.environ['VIVADOHLS_INCLUDE_PATH']=site.getsitepackages()[0] + "/bnn/" Then used the terminal to run the setup. What I typed on the terminal on PYNQ was: sudo python3.6 setup.py install, it did show running install at first, but at last it shows syntax Error. Could you guys help me figure out the problem? the detail is below. Thank you!

byte-compiling build/bdist.linux-armv7l/egg/bnn/src/training/characters-gen-binary-weights.py to characters-gen-binary -weights.cpython-36.pyc byte-compiling build/bdist.linux-armv7l/egg/bnn/src/training/lfc.py to lfc.cpython-36.pyc byte-compiling build/bdist.linux-armv7l/egg/bnn/src/training/augmentors.py to augmentors.cpython-36.pyc byte-compiling build/bdist.linux-armv7l/egg/bnn/src/training/gtsrb.py to gtsrb.cpython-36.pyc byte-compiling build/bdist.linux-armv7l/egg/bnn/src/training/finnthesizer.py to finnthesizer.cpython-36.pyc File "build/bdist.linux-armv7l/egg/bnn/src/training/finnthesizer.py", line 60 print "Layer %d: %d x %d, SIMD = %d, PE = %d" % (l, paddedH, paddedW, simdCount, peCount) ^ SyntaxError: invalid syntax

byte-compiling build/bdist.linux-armv7l/egg/bnn/init.py to init.cpython-36.pyc installing package data to build/bdist.linux-armv7l/egg running install_data creating build/bdist.linux-armv7l/egg/EGG-INFO copying bnn_pynq.egg-info/PKG-INFO -> build/bdist.linux-armv7l/egg/EGG-INFO copying bnn_pynq.egg-info/SOURCES.txt -> build/bdist.linux-armv7l/egg/EGG-INFO copying bnn_pynq.egg-info/dependency_links.txt -> build/bdist.linux-armv7l/egg/EGG-INFO copying bnn_pynq.egg-info/top_level.txt -> build/bdist.linux-armv7l/egg/EGG-INFO writing build/bdist.linux-armv7l/egg/EGG-INFO/native_libs.txt zip_safe flag not set; analyzing archive contents... bnn.pycache.bnn.cpython-36: module references file creating 'dist/bnn_pynq-0.1-py3.6.egg' and adding 'build/bdist.linux-armv7l/egg' to it removing 'build/bdist.linux-armv7l/egg' (and everything under it) Processing bnn_pynq-0.1-py3.6.egg removing '/opt/python3.6/lib/python3.6/site-packages/bnn_pynq-0.1-py3.6.egg' (and everything under it) creating /opt/python3.6/lib/python3.6/site-packages/bnn_pynq-0.1-py3.6.egg Extracting bnn_pynq-0.1-py3.6.egg to /opt/python3.6/lib/python3.6/site-packages File "/opt/python3.6/lib/python3.6/site-packages/bnn_pynq-0.1-py3.6.egg/bnn/src/training/gtsrb-gen-binary-weights.py ", line 105 print "Using peCount = %d simdCount = %d for engine %d" % (peCount, simdCount, convl) ^ SyntaxError: invalid syntax

File "/opt/python3.6/lib/python3.6/site-packages/bnn_pynq-0.1-py3.6.egg/bnn/src/training/cifar10-gen-binary-weights. py", line 60 print "Using peCount = %d simdCount = %d for engine %d" % (peCount, simdCount, convl) ^ SyntaxError: invalid syntax

File "/opt/python3.6/lib/python3.6/site-packages/bnn_pynq-0.1-py3.6.egg/bnn/src/training/binary_net.py", line 58 def c_code(self, node, name, (x,), (z,), sub): ^ SyntaxError: invalid syntax

File "/opt/python3.6/lib/python3.6/site-packages/bnn_pynq-0.1-py3.6.egg/bnn/src/training/finnthesizer.py", line 60 print "Layer %d: %d x %d, SIMD = %d, PE = %d" % (l, paddedH, paddedW, simdCount, peCount) ^ SyntaxError: invalid syntax

bnn-pynq 0.1 is already the active version in easy-install.pth

Installed /opt/python3.6/lib/python3.6/site-packages/bnn_pynq-0.1-py3.6.egg Processing dependencies for bnn-pynq==0.1 Finished processing dependencies for bnn-pynq==0.1 bash: /opt/python3.6/lib/python3.6/site-packages/bnn/src/network//make-sw.sh: No such file or directory Traceback (most recent call last): File "setup.py", line 76, in run_make(XILINX_BNN_ROOT+"/bnn/src/network/", "cnv-pynq" ,"python_sw") File "setup.py", line 65, in run_make status = subprocess.check_call(["bash", src_path + "/make-sw.sh", network, output_type]) File "/opt/python3.6/lib/python3.6/subprocess.py", line 291, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['bash', '/opt/python3.6/lib/python3.6/site-packages/bnn/src/network//make-sw. sh', 'cnv-pynq', 'python_sw']' returned non-zero exit status 127. image

image image

image

image

giuliogamba commented 6 years ago

Hi,

you should:

  1. Copy the original repo into the pynq board;
  2. in the terminal, move the the BNN-PYNQ folder and run sudo pip3.6 install ./

The repository actually includes already pre-compiled objects, so it's not necessary to set the VIVADOHLS_INCLUDE_PATHenvironment variable in installation phase.

Hope this helps

zzeng00 commented 6 years ago

Thank you, I tried sudo pip3.6 install ./ --upgrade, it works!