-
Notifications
You must be signed in to change notification settings - Fork 233
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
InvalidArgumentError: You must feed a value for placeholder tensor #283
Comments
Hi @vevefu, I checked your example and it turns out you just need to pass the import numpy as np
import tensorflow as tf
import innvestigate
from keras.models import Sequential
from keras.layers import Dense, Flatten
from keras.layers.convolutional import Conv1D
from keras.layers.convolutional import MaxPooling1D
tf.compat.v1.disable_eager_execution()
input_shape = (3, 1)
X = np.random.rand(100, *input_shape)
y = np.random.rand(100)
X_train, X_test = np.vsplit(X, [80])
y_train, y_test = np.split(y, [80])
model = Sequential()
model.add(Conv1D(filters=64, kernel_size=2, activation="relu", input_shape=input_shape))
model.add(MaxPooling1D(pool_size=2))
model.add(Flatten())
model.add(Dense(5, activation="relu"))
model.add(Dense(1))
model.compile(optimizer="adam", loss="mse")
model.fit(X_train, y_train, epochs=10, verbose=0)
explainer_lrp = innvestigate.create_analyzer("gradient", model)
explanations_lrp = explainer_lrp.analyze(X_test)
print(explanations_lrp) |
Thank you very much! |
Hello,
And I get the following error:
My environment details are: Could you kindly let me know how to fix this? |
Hi @madarax64, I was able to narrow your issue down to the use of As a temporary workaround until we've fixed this issue, you could try to convert your |
Hello @adrhill , |
During inference, gamma * (batch - self.moving_mean) / sqrt(self.moving_var+epsilon) + beta You could define |
Okay, got it. Thanks! |
Hi!
Thanks for this great library!
I am using tensorflow version 2.9.1. and innvestigate 2.0.0 and get the following error message when trying to analyze a keras model (for example a simple CNN):
InvalidArgumentError: You must feed a value for placeholder tensor 'input_1_3' with dtype float and shape [?,3,1]
[[{{node input_1_3}}]]
The error appears when running innvestigate.analyze() (so in the last line of the code below), while the analyzer is created without a problem.
Any ideas what I might be doing wrong?
The text was updated successfully, but these errors were encountered: