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
I am not sure if I am using this correctly but I am trying to experiment with Kerassurgeon to delete and add layers. Currently me and my team are struggling to get the delete function from operations to work properly. Below is how the model is being created, and the final line is how we are trying to delete a layer.
The issue comes about that when we go to do this we get the error.
TypeError: Keras symbolic inputs/outputs do not implement __len__. You may be trying to pass Keras symbolic inputs/outputs to a TF API that does not register dispatching, preventing Keras from automatically converting the API call to a lambda layer in the Functional Model. This error will also get raised if you try asserting a symbolic input/output directly.
Not really sure what is going on in this scenario. Any light on the issue would be helpful.
The text was updated successfully, but these errors were encountered:
I had the same error with TF2.4.0 and TF2.5.0. Downgrading to TF2.3.0 fixed the problem. I guess this repo needs an upgrade tot support the later TF releases.
I had the same error with TF2.4.0 and TF2.5.0. Downgrading to TF2.3.0 fixed the problem. I guess this repo needs an upgrade tot support the later TF releases.
I am not sure if I am using this correctly but I am trying to experiment with Kerassurgeon to delete and add layers. Currently me and my team are struggling to get the delete function from operations to work properly. Below is how the model is being created, and the final line is how we are trying to delete a layer.
model = Sequential()
model.add(Dense(12, input_dim = 8, activation = "relu"))
model.add(Dense(8, activation = "relu"))
model.add(Dense(1, activation = "sigmoid"))
model.compile(loss = "binary_crossentropy", optimizer = "adam", metrics = ["accuracy"])
model.fit(X, y, epochs = 150, batch_size = 10)
model = delete_layer(model, model.layers[1])
The issue comes about that when we go to do this we get the error.
TypeError: Keras symbolic inputs/outputs do not implement
__len__
. You may be trying to pass Keras symbolic inputs/outputs to a TF API that does not register dispatching, preventing Keras from automatically converting the API call to a lambda layer in the Functional Model. This error will also get raised if you try asserting a symbolic input/output directly.Not really sure what is going on in this scenario. Any light on the issue would be helpful.
The text was updated successfully, but these errors were encountered: