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

Change the dimension of Input #136

Closed 1430533056 closed 4 years ago

1430533056 commented 4 years ago

Hello, I have trained a new network with input dimension 188x188x3, all params, .bit file and .so file are generated. The problem is that the accuracy in pynq is much slow than the training phrase in theano. I guess the reason is the change of the input dimension. To apply the changes, I replace 32 with 188 in line 163,168,169 in file top.cpp and in line 59, 60 in main_python.cpp.. I wonder whether I should make changes in other places ?

giuliogamba commented 4 years ago

Hi,

if you changed the input dimensions, most likely all the intermediate dimensions will also change. Those are listed in the config.h file as IFM_DIM and OFM_DIM as in the example here. That file is automatically generated from the export script here, line 42 and 43. Those have to be adjusted according to the topology you trained with the new input dimension.

1430533056 commented 4 years ago

I have adjusted the topology in gtsrb-gen-binary-weights.py and the config.h is automatically generated. But it still has a very low accuracy. Besides the above files, any other files should I make changes? By the way, does the ConvLayer support padding ?