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 reading in QKeras model #563

Closed
jmitrevs opened this issue Jun 3, 2022 · 4 comments
Closed

problem reading in QKeras model #563

jmitrevs opened this issue Jun 3, 2022 · 4 comments
Assignees

Comments

@jmitrevs
Copy link
Contributor

jmitrevs commented Jun 3, 2022

I haven't gotten a chance to debug much, but reading in a QKeras model fails for me at:

act_layer['name'] = layer['name'] + '_' + layer['activation']

when the layer name is "q_conv1d_18" and the activation is {'class_name': 'quantized_relu', 'config': {'bits': 8, 'integer': 0, 'use_sigmoid': 0, 'negative_slope': 0.0, 'use_stochastic_rounding': False, 'relu_upper_bound': None, 'qnoise_factor': 1.0}}, and you can't concatenate a string and dictionary. Any recommendations on how to fix this problem? Or does one not use keras_to_hls for qkeras models (called from convert_from_keras_model)?

@jmitrevs jmitrevs self-assigned this Jun 6, 2022
@jmitrevs
Copy link
Contributor Author

jmitrevs commented Jun 6, 2022

The issue is that hls4ml doesn't seem to handle the case when the QKeras model doesn't explicitly use QActivation but instead passes, for example, activation=quantized_relu(..) to, for example, QConv1D. I will try to add support for this.

@thesps
Copy link
Contributor

thesps commented Jun 7, 2022

Hey, that's actually recently been addressed in #553 (not merged at time of writing)

@thesps
Copy link
Contributor

thesps commented Jun 7, 2022

That PR is merged now. Could you try again on master branch?

@jmitrevs
Copy link
Contributor Author

jmitrevs commented Jun 7, 2022

The problem is fixed.

@jmitrevs jmitrevs closed this as completed Jun 7, 2022
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