In the current version of hls4ml, if one use the key "KerasH5" and not supplying the json model file to load the Keras model, the framework will try to decode the string in h5.attrs[ ] in utf-8 and fails. This PR patchs this issue by doing a type check first.
Type of change
For a new feature or function, please create an issue first to discuss it
with us before submitting a pull request.
Note: Please delete options that are not relevant.
[x] Bug fix (non-breaking change that fixes an issue)
[ ] Documentation update
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] A new research paper code implementation
[ ] Other (Specify)
Tests
:memo: Please describe the tests that you ran to verify your changes.
Provide instructions so we can reproduce.
Please also list any relevant details for your test configuration.
Test Configuration:
Unit test added for KerasH5 loader at test/pytest/test_keras_h5_loader.py
Create any keras model, save it to .h5 and use only the KerasH5 without providing the in the config dictionary (or command line interface) to load it model json -> crash
A# Description
In the current version of hls4ml, if one use the key "KerasH5" and not supplying the json model file to load the Keras model, the framework will try to decode the string in h5.attrs[ ] in utf-8 and fails. This PR patchs this issue by doing a type check first.
Type of change
For a new feature or function, please create an issue first to discuss it with us before submitting a pull request.
Note: Please delete options that are not relevant.
Tests
Test Configuration: Unit test added for KerasH5 loader at
test/pytest/test_keras_h5_loader.py
Create any keras model, save it to .h5 and use only theKerasH5
without providing the in the config dictionary (or command line interface) to load it model json -> crashChecklist