Skip to content

Keras v3 model profiling import bug #1415

@Chriisbrown

Description

@Chriisbrown

When attempting to use the function numerical(model=kerasmodel, hls_model=hlsmodel, X=X_test) from hls4ml.model.profiling with the model as a keras v3 model the command fails at

model = keras_v2_to_hls(yamlConfig)

As hls4ml attempts to convert a keras v3 model as a keras v2 model. This conversion is handled correctly later in the file

if 'KerasModel' in config:
import keras
if keras.__version__ >= '3.0':
return keras_v3_to_hls(config)
return keras_v2_to_hls(config)

If the same code is inserted back into L125 the numerical profiling succeeds

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions