Skip to content

Keras 3 version compatibility  #214

@jonnor

Description

@jonnor

Hi. I cannot see that there is any documentation on which Keras versions are supported. I tried running with the latest versions as per today - Keras 3.1.1.

This gives the following exception.

Traceback (most recent call last):
  File "/home/jon/projects/embeddedml/handson/nnom/train_mobilenet.py", line 27, in <module>
    nnom.generate_model(model, data, name=out_path)
  File "/home/jon/projects/embeddedml/handson/nnom/nnom/scripts/nnom.py", line 757, in generate_model
    quantize_weights(model, per_channel_quant=per_channel_quant, name=name, format=format, layer_q_list=layer_q_list)
  File "/home/jon/projects/embeddedml/handson/nnom/nnom/scripts/nnom.py", line 610, in quantize_weights
    print(dir(layer.outbound_nodes[0].output_tensors))
              ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Conv2D' object has no attribute 'outbound_nodes'. Did you mean: '_outbound_nodes'?

I tried to fix that line, but then just get stuck a couple of lines down.

Traceback (most recent call last):
  File "/home/jon/projects/embeddedml/handson/nnom/train_mobilenet.py", line 27, in <module>
    nnom.generate_model(model, data, name=out_path)
  File "/home/jon/projects/embeddedml/handson/nnom/nnom/scripts/nnom.py", line 757, in generate_model
    quantize_weights(model, per_channel_quant=per_channel_quant, name=name, format=format, layer_q_list=layer_q_list)
  File "/home/jon/projects/embeddedml/handson/nnom/nnom/scripts/nnom.py", line 614, in quantize_weights
    ('batch_normalization' in layer.outbound_nodes[0].outbound_layer.name):
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Node' object has no attribute 'outbound_layer'

So I believe Keras 3.x does not really work. But which version should I go back to that is known to be working?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions