You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I am trying to convert an autoencoder Keras model using command 'hls4ml convert -c keras-auto-config.yml
Loading configuration from keras-auto-config.yml'. Run into error like this:
Interpreting Sequential
Input shape: [200]
Topology:
Layer name: dense_1, layer type: Dense, current shape: [[None, 200]]
Layer name: activation_1, layer type: Activation, current shape: [[None, 256]]
Traceback (most recent call last):
File "/home/xyzhou/anaconda3/bin/hls4ml", line 138, in <module>
main()
File "/home/xyzhou/anaconda3/bin/hls4ml", line 58, in main
args.func(args)
File "/home/xyzhou/anaconda3/bin/hls4ml", line 87, in convert
model = hls4ml.converters.keras_to_hls(yamlConfig)
File "/home/xyzhou/anaconda3/lib/python3.7/site-packages/hls4ml/converters/keras_to_hls.py", line 174, in keras_to_hls
output_shapes[keras_layer['name']] = input_shapes #[0]
KeyError: 'name'
The model arch is like this:
input_dim = 200 in my case
def autoencoder_mlp0(input_dim):
model = Sequential()
model.add(Dense(256, input_dim=input_dim))
model.add(Activation('relu'))
model.add(Dropout(0.2))
model.add(Dense(128))
model.add(Activation('relu'))
model.add(Dropout(0.2))
model.add(Dense(256))
model.add(Activation('relu'))
model.add(Dropout(0.2))
model.add(Dense(input_dim, activation='linear'))
model.summary()
return model
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Anything I can do to deal with this?
Thank you!
The text was updated successfully, but these errors were encountered:
This is because you use a Sequential model. We have fixed this issue in the branch for PR #195, so you can try using that branch (soon to be master anyway), or you can manually fix it applying the change from e492ae7.
When I am trying to convert an autoencoder Keras model using command 'hls4ml convert -c keras-auto-config.yml
Loading configuration from keras-auto-config.yml'. Run into error like this:
The model arch is like this:
input_dim = 200 in my case
The text was updated successfully, but these errors were encountered: