Comments (7)
I will investigate
from finn.
Hi @reshkor ,
I have mostly performed your actions.
- I have created .bit file through FINN framework
- In bnn.py, I modified the bit file to load in the init of PynqBNN class.
- I try to comment out
self.interface.load_parameters(params.encode())
as you say (but i don't understand why) - I start the cifar10 notebook example, but when i launch BNN in hardware the process blocks on
self.interface.inference(....)
Can you explain me what are the steps that you follow?
Thanks,
Sara
from finn.
Hello @saraballeri ,
- I hope you didn't change layer composition in .prototxt file when creating .bit file in FINN. FINN only supports two networks.
- What did you modify here? The only thing I did is to comment
self.interface.load_parameters(params.encode())
line https://github.com/Xilinx/BNN-PYNQ/blob/65f212439715bfd214104b23d418b167d5f840c9/bnn/bnn.py#L112 - The line will try to load the network parameters stored in BNN-PYNQ/bnn/params folder. FINN .bit file has the parameters baked already thus loading is not needed.
- Seems like it can't access the network parameters to make a prediction, since the commented line prevents loading BNN-PYNQ parameter files. Probably BNN-PYNQ .bit file is loaded instead of FINN .bit file (happened to me).
Slightly elaborated steps:
- I guess you have a .bit file that complies with networks described here https://docs.google.com/presentation/d/17oorGvtUbdFd-o1OzSuxGCSrWsvm_S2ftC1UC2FLtuE/edit#slide=id.p3 slides 12 or 20. If not you can use cnv-w1a1.prototxt and cnv-w1-a1.caffemodel that are already supplied as an example and run the command to synthesize CNV network.
- Place the generated .bit file in BNN-PYNQ/bnn/bitstreams/pynqZ1-Z2 folder and rename it to cnvW1A1-pynqZ1-Z2.bit. So instead of original BNN-PYNQ .bit file the FINN .bit file is loaded in bnn overlay. I installed BNN-PYNQ as a development module thus it was in /home/xilinx/src/bnn-dev/bnn but if you follow the instructions on BNN-PYNQ it is installed somewhere in /opt/python/../../../bnn
- Comment the line
self.interface.load_parameters(params.encode())
in BNN-PYNQ/bnn/bnn.py - Run CIFAR10 example. In line
hw_classifier = bnn.CnvClassifier(bnn.NETWORK_CNVW1A1,'cifar10',bnn.RUNTIME_HW)
bnn.NETWORK_CNVW1A1 will load cnvW1A1-pynqZ1-Z2.bit from bitstreams folder, which should be the FINN generated .bit file.
NOTE: If you first run CIFAR10 notebook example with default settings(so loading parameters from BNN-PYNQ/bnn/params folder and original cnvW1A1-pynqZ1-Z2.bit) and then make changes to load the FINN .bit file without resetting the board, the CIFAR10 notebook example will be able to classify pictures correctly. However after the reset of the Pynq board all pictures will be classified as 'Deer' with FINN .bit file.
Hope it helps
from finn.
Hi @reshkor ,
thank you for your quick response and your full explanation.
I'll try again to perform those steps.
Anyway:
- Is it possible to use binarized networks like AlexNet, GoogleNet, etc. provided by HWGQ Caffe?
- Can I only use cnvw1a1 and lfcw1a1 networks on FINN or can I provide to FINN an other binarized network different from cnvw1a1 and lfcw1a1?
Sorry for the lot of questions, but I'm doing my master thesis and I'm coming close to the world of neural networks on FPGA now.
Thanks a lot,
Sara
from finn.
- Those networks are not supported by FINN and BNN-PYNQ, only cnv and lfc are.
- You can re-use structures of cnv and lfc (basicly .prototxt files) to train networks to detect different objects. In the .prototxt you can change number of output classes (last fully connected layer). For BNN-PYNQ it is limited to 64 not sure if it is the same for FINN.
You can create your binarized network with custom number of layers but you would also have to add support for the new overlay in BNN-PYNQ (check out power-point presentation I linked in previous post, it gives some tips from slide 27). However it seems like quite a bit of work and as I'm also writing master thesis I don't have much time to spend on implementing support for new network overlays.
from finn.
@reshkor ,
exactly the same things for me.
I cannot spend much time on implementing new overlays :(
Thanks very much, your explanation has removed all doubt from my mind.
Sara
from finn.
I'm closing all issues relating to the v.01 version in preparation for the new release. Please note that v0.1 is now deprecated and unsupported.
from finn.
Related Issues (20)
- Unrecognized shell_flow_type: None HOT 1
- U-Net on PYNQ HOT 4
- Problem downloading xrt_202220.2.14.354_22.04-amd64-xrt.deb within run-docker.sh HOT 7
- Issues in getting started on Windows HOT 2
- out of the range for parameter 'FIFO depth(FIFO_DEPTH)' HOT 4
- Redeclaration of streams in StreamingDataWidthConverter_hls? HOT 1
- RadioML: Verification step folded_hls_cppsim throws an error
- local variable 'pad_in' referenced before assignment
- MobileNet-V1: Verification step stitched_ip_rtlsim throws an error
- Issue with launching build of IP: Exception: CreateStitchedIP failed, no wrapper HDL found HOT 2
- Memory Primitive Issue HOT 1
- Design built using RTL backend produces incorrect results HOT 4
- missing class "InferPool_Batch()" HOT 2
- 404 Not Found [IP: 185...] HOT 4
- Docker image build Fails Tests HOT 1
- ModuleNotFoundError: No module named 'finn.transformation.qonnx' HOT 1
- Adding typing annotations to FINN
- Fixed - Unable to run jupyter notebook HOT 3
- PermissionError: [Errno 13] Permission denied:, and WARNING: Unable to find /tools/Xilinx/Vitis/2022.2/settings64.sh HOT 1
- IP definition not found for VLNV HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from finn.