Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem running examples (bad results / python errors) #99

Closed
Mjonir opened this issue Nov 5, 2020 · 2 comments
Closed

Problem running examples (bad results / python errors) #99

Mjonir opened this issue Nov 5, 2020 · 2 comments

Comments

@Mjonir
Copy link

Mjonir commented Nov 5, 2020

Hello,

I have been trying to run the included examples but have ran into issues:

mnist_simple.py ran to completion after I applied the cudNN fix and renamed 'acc' and 'val_acc' to 'accuracy' and 'val_accuracy' respectively. I attach the log and self-evaluation results which are as expected. However, when I try to run the generated quantized network in C, the results are heavily skewed towards one label. I attach the run log, and a simple C file with Makefile (meant to be placed and ran from the mnist-simple directory) to reproduce the issue:
mnist-simple.zip

auto_test.py crashes during execution, here is the (anonymized) execution log:
auto_test_log.txt

Thank you in advance

@majianjia
Copy link
Owner

Hi @Mjonir ,
May I know the TF version you are using? recommened TF2.2+. For the crash, are you setting Keras to 'CHW' or 'channel first'? The script currently only support the default HWC shape format.

I am checking both attachement you provided.

Would you use the example weights.h in the example folder other that the one you converted from you model to test? see if the prediction is correct? for the mnist-simple example.

Thanks,
Jianjia

@Mjonir
Copy link
Author

Mjonir commented Nov 6, 2020

Hello,
I am using tensorflow 2.3.1, but I was indeed setting Keras to channels_first in keras.json from previous experiments with CMSIS-NN (forgot about that one!). After fixing this (and applying the cudNN fix), both scripts ran with the expected results.

For information, with multiple GPUs I have to use this cudNN fix (loop over GPUs) or I get the error below:

for device in physical_devices:
        tf.config.experimental.set_memory_growth(device, True)

ValueError: Memory growth cannot differ between GPU devices

Also for informaiton, the included weights.h failed at compile-time, from what I assume is an inconsistency with the recent interface changes. Here is the full compile log:
compile_log.txt

Thank you very much for the support, I will be moving on to trying it on my own model

@Mjonir Mjonir closed this as completed Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants