Closed franhervas99 closed 1 day ago
Same answer as #1133. 0.8.1 is really old by now and there are significant improvements in the current main branch. You can install it with pip install git+https://github.com/fastmachinelearning/hls4ml.git
Updating to the last version on main branch gives me the same error.
Upon investigation, this is caused by your environment being based on new TF and Keras v3, which are not supported. There's some progress on v3 support in #1116. To install usable hls4ml from the main branch, you will need python 3.10 or 3.11 and TF 2.8 to 2.14. See #1136 for a list of dependencies of the current version.
Hello @vloncar , Chaning TF version to 2.12 solves the issue. Thank you so much for your solution!
Prerequisites
Please make sure to check off these prerequisites before submitting a bug report.
Quick summary
I have a keras model which has, in the input layer, in config key, a key that is "batch_shape", but when I run config_from_keras_model function, an error is thrown "KeyError: 'batch_input_shape'". Changing the lines 11 and 21 from core.py file, to be batch_shape instead of batch_input_shape, fixes the error.
Details
Please add to the following sections to describe the bug as accurately as possible.
Steps to Reproduce
Expected behavior
Generate the model config for converting the model to HLS.
Actual behavior
An error is thrown:
Optional
Possible fix
layer['input_shape'] = keras_layer['config']['batch_input_shape'][1:]
tolayer['input_shape'] = keras_layer['config']['batch_shape'][1:]
output_shape = keras_layer['config']['batch_input_shape']
tooutput_shape = keras_layer['config']['batch_shape']