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

Value Error occurs when I exercise your demo code #71

Open
htma opened this issue May 21, 2024 · 0 comments
Open

Value Error occurs when I exercise your demo code #71

htma opened this issue May 21, 2024 · 0 comments

Comments

@htma
Copy link

htma commented May 21, 2024

Hi, my demo code as followed your example :
In [ ] : # -------------------------------------------------------------------------------
import numpy as np
import tensorflow as tf
from tensorflow.keras import Input
from tensorflow.keras.layers import Dense, LSTM
from tensorflow.keras.models import load_model, Model

from attention import AttentionNum_samples, time_steps, input_dim, output_dim = 100, 10, 1, 1
data_x = np.random.uniform(size=(num_samples, time_steps, input_dim))
data_y = np.random.uniform(size=(num_samples, output_dim))

In[ ]:

Define/compile the model.

model_input = Input(shape=(time_steps, input_dim))
model_input.shape

x = LSTM(32, return_sequences=True)(model_input)
x = Attention(units=32)(x)

------------------------------------------------------------------------------------------------------------------------

Here when I run above cells, an error always occurs:

[ValueError: Only input tensors may be passed as positional arguments. The following argument value should be passed as a keyword argument: None (of type <class 'NoneType'>)]

What can i Do it?
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant