Skip to content

Commit

Permalink
Fix keras model loading issue with loading model with KerasH5
Browse files Browse the repository at this point in the history
  • Loading branch information
calad0i committed Oct 14, 2022
1 parent d54843d commit 6c90b69
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hls4ml/converters/keras_to_hls.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,10 @@ def keras_to_hls(config):
if model_arch is None:
raise ValueError('No model found in config file.')
else:
model_arch = json.loads(model_arch.decode('utf-8'))
# model_arch should be a string by default. Keeping this if just for compatibility.
if isinstance(model_arch, bytes):
model_arch = model_arch.decode('utf-8')
model_arch = json.loads(model_arch)
reader = KerasFileReader(config)
else:
raise ValueError('No model found in config file.')
Expand Down

0 comments on commit 6c90b69

Please sign in to comment.