ML-examples icon indicating copy to clipboard operation
ML-examples copied to clipboard

Error with nn_quantiser.py

Open ando2097 opened this issue 4 years ago • 1 comments

issue

attempting to run the cmsisnn-cifar10 ML-example

command typed

python3 nn_quantizer.py --model models/cifar10_m4_train_test.prototxt --weights models/cifar10_m4_iter_70000.caffemodel.h5 --save models/cifar10_m4.pkl

error message

I0804 16:46:04.856118 22909 net.cpp:257] Network initialization done. I0804 16:46:04.871187 22909 net.cpp:801] Ignoring source layer cifar I0804 16:46:04.871275 22909 hdf5.cpp:33] Datatype class: H5T_FLOAT Traceback (most recent call last): File "nn_quantizer.py", line 614, in my_model.get_graph_connectivity() File "nn_quantizer.py", line 234, in get_graph_connectivity for key, value in self.top_blob.iteritems(): AttributeError: 'dict' object has no attribute 'iteritems'

ando2097 avatar Aug 04 '21 15:08 ando2097

Hi there,

Think this is an issue with Python2 vs Python3. Python3 changed iteritems() to items() and unfortunately we have not updated this example yet. To fix it either use Python2 or replace iteritems() to items() in the code.

We have a plan to clean up the examples in this repository, so this will be on our radar to fix as well.

Burton2000 avatar Aug 05 '21 09:08 Burton2000