finn-examples: Error building Mobilenet-v1
Hi,
I’m trying to build the mobilenet-v1 model. I followed all the steps in the README of the repository. However I get this error:
File "/opt/conda/lib/python3.8/site-packages/sigtools/_signatures.py", line 83, in <module>
@attr.define(eq=False)
AttributeError: module 'attr' has no attribute 'define'
Do you know how to solve it? Thanks for your help
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 16 (1 by maintainers)
Hi @giop98 , can you try if this patch: https://github.com/Xilinx/finn-examples/pull/55/commits/11a1cb340612f3ce8e8910cf352517092670ebb2 solves your problem? The accuracy drop your seeing is so immense because the weights don’t get correctly loaded with the driver.py on main. We’re working on the solution, see #55
Dear @mmrahorovic, thanks for the help. I was able to build mobilenet correctly. However, I’m having some issues in testing the throughput. When I launch the script to test the throughput, it gets stuck indefinitely. I’m still on a ZCU104. Could this be because you are forced to move some resources to URAM? Thanks for the help
EDIT: Seems I solved my issue. I was setting the batchsize to a value that was too big. Now everything seems to work correctly. The maximum value of batch size I reached is 100, when jumping to 1000 the throughput test got stuck.
Hi @giop98, sorry for the delayed response. Please check out the latest FINN-examples release, that should resolve your issue. However, to build the model for the ZCU104 board, we are forced to move some resources to URAM to enable the model to fit on the board. This requires to initialize the weights during runtime. Unfortunately, we have seen some issues with runtime-writeable weights leading to essentially an accuracy drop. Until we have resolved the issue, our advice would be to either target a U250 with Pynq v3.0.1 / FINN-examples v0.0.6 (since that particular model does not utilize URAM), or a ZCU104 with Pynq v2.6.1 (i.e. FINN-examples v0.0.5).
Thanks for all the clear explanations. Tomorrow I will try to replicate your setup (I anticipate that I have the 2022.1 Xilinx Tools) and see what happens. I will let you know and then we can think of a fix!
@giop98 Much thanks for the response! This is an out-of-the-box example – I am just trying to rebuild things from scratch to understand more about how FINN works to eventually use it for a test model I have. The only modification I made was to the
get-finn.shscript to match the hash you posted above. My target is a ZCU104 dev board but I’m not doing anything special with the config to target that.I tried running things from scratch (completely removed the finn-examples repo and started over from square one.) Same results.
I’m running Ubuntu 20.04:
I’ve got the following variables configured before I do anything:
Here is my exact sequence of steps:
git clone https://github.com/Xilinx/finn-examples.gitcd finn-examples/build/get-finn.shto update REPO_COMMIT to “abc500078692f7dec1f67aa7af4dead879eb1513”./get-finn.shcd mobilenet-v1/models/./download-model.shcd ../../..export FINN_EXAMPLES=$PWDcd $FINN_EXAMPLES/build/finn./run-docker.sh build_custom $FINN_EXAMPLES/build/mobilenet-v1The step that it fails is 7/13:
The traceback error is identical to the one I copied in my post above.
I ran into this exact problem with MobileNet-v1 and tried your REPO_COMMIT fix from PR #41. That got me past the
attrerror, but unfortunately lead to a different problem:I checked and my
build/finn/requirements.txtlooks identical to the one you posted:After some research I solved the issue.
The problem is in the
get-finn.shfile, in particular in theREPO_COMMITvariable. In the file there is the commit 96c0f5e3678abd7b1eaab2a2b4f8e937ac1f48b8. However this clones a version of the finn repository that has the followingrequirements.txt:However, there is a package missing, that is the sigtools. The correct commit is the last one, at the time I’m writing, in the finn repository. It’s SHA is abc500078692f7dec1f67aa7af4dead879eb1513.
In this version, the
requirements.txtis the following, and this is the correct one:In the PR #41 there is the fix for this problem