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

issue with ApplyAlpha for conv2d layers #622

Closed
m-glowacki opened this issue Jul 27, 2022 · 2 comments
Closed

issue with ApplyAlpha for conv2d layers #622

m-glowacki opened this issue Jul 27, 2022 · 2 comments
Labels

Comments

@m-glowacki
Copy link

I'm attempting a hls synthesis of a simple quantised CNN model, featuring:

  • conv_2d layers
  • dense layers
  • batch normalisation

the model is quantised during training, with no alpha scaling (alpha=1)

the synthesis breaks with this exception:

  File "/software/ys20884/miniconda3/envs/ml_env/lib/python3.8/site-packages/hls4ml/model/layers.py", line 105, in _validate_attributes
    raise Exception('Unexpected value of attribute "{}" of layer "{}" ({}). Expected {}, got {} ({})'
Exception: Unexpected value of attribute "n_in" of layer "q_conv2d_alpha" (ApplyAlpha). Expected <class 'int'>, got <class 'NoneType'> (None)

this is the layer in question:

Layer name: q_conv2d, layer type: QConv2D, input shapes: [[None, 20, 12, 1]], output shape: [None, 18, 10, 4]

I'm on the current main branch

I previously had no issues with the same model on release 0.6.0

thanks for taking a look.

@m-glowacki m-glowacki added the bug label Jul 27, 2022
@bo3z
Copy link
Contributor

bo3z commented Jul 27, 2022

Hi @m-glowacki. Thanks for raising this issue. I believe this has been addressed in PR #612 . Could you check out the branch and see if it resolves the problem?

@m-glowacki
Copy link
Author

thanks @bo3z! Indeed this has fixed things, issue closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants