Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong TypeError #1003

Open
Sorooshi opened this issue Mar 21, 2024 · 0 comments
Open

Wrong TypeError #1003

Sorooshi opened this issue Mar 21, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Sorooshi
Copy link

Sorooshi commented Mar 21, 2024

Describe the bug

I am trying to fine-tune an AE-LSTM, using keras tuner, to use the output of the embedding layer in the rest of my project.

To this end, I have defined two classes, one for train and test the fine-tuned model, which I called "LstmAe", and the other to fine-tune it, which I called "ApplyLstmAe."

The problem is when I try execute my fine_tune_the_model() method in the latter class I face the following error:

TypeError: Inputs to a layer should be tensors. Got: <keras_tuner.src.engine.hyperparameters.hyperparameters.HyperParameters object at 0x7fdc7c3438e0>

My failed attempted:

Changing build method as staticmethod, define "hps" inside the build function, changing InputLayer to Input etc., unfortunately I failed.
Googling also did not help me to find a proper answer (although one unanswered post on SO and one issue on GitHub are available).

To Reproduce

In the link below you can find the google-colab file, however, I cannot share the data
https://colab.research.google.com/drive/1rJMqaeAjsKvWvI3EcdiHY2ZPxCJCKu-y?usp=sharing

Expected behavior

Method fine_tune_the_model does not accept any inputs, I expect it to initiate the tuner; however, instead it produces such an error.

Would you like to help us fix it?
Unofortunately, I cannot help.

@Sorooshi Sorooshi added the bug Something isn't working label Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant