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

ValueError #4

Open
tenosel opened this issue Jan 6, 2021 · 2 comments
Open

ValueError #4

tenosel opened this issue Jan 6, 2021 · 2 comments

Comments

@tenosel
Copy link

tenosel commented Jan 6, 2021

Hello,

thank you for providing your code!
I tried running the provided example (without changes) for the parkinson dataset and there seems to be an error. So the training is fine but wenn dasp = DASP(model) is executed, I get the following message:

ValueError: Layer dense_1 expects 1 input(s), but it received 3 input tensors. Inputs received: [<tf.Tensor 'Placeholder:0' shape=(None, 18) dtype=float32>, <tf.Tensor 'Placeholder_1:0' shape=(None, 18) dtype=float32>, <tf.Tensor 'Placeholder_2:0' shape=(None, 1) dtype=float32>]

The problem appears to be while executing the line:

first_layer_output = ProbDenseInput(l.units, activation=l.activation, name=l.name)(self.inputs)

from the dasp.py file. Do you know, what might be the problem? Thanks in advance!

@TSEGGuillaume
Copy link

TSEGGuillaume commented Feb 9, 2022

Hello,

I have the same problem here. It seems to be a side effect of Keras updates (perhaps about input_spec variable ?).
I am trying to run the mnist example to better visualize your article and adapt the approach to a more complex network.

Do you know how to solve this issue?
Thanks in advance.

EDIT : I forgot to mention the most important : I'm using TF: 2.7.0 and Keras: 2.7.0 . Except for some minor corrections, everything works well with TF: 1.15.2 and Keras: 2.3.1 .

@YunHisangTang
Copy link

YunHisangTang commented Mar 8, 2022

I have the same problem here.
It seems that the call and build functions in this line are not working.

DASP/dasp/dasp.py/ line 80
first_layer_output = ProbDenseInput(l.units, activation=l.activation, name=l.name)(self.inputs)

DASP/dasp/layers/dense.py line 11 and 21
def build(self, input_shape): return super(ProbDenseInput, self).build(input_shape[0])
def call(self, inputs): inputs, mask, k = inputs...

Guess it's a direct call to the default keras Dense code?
Try to change the code here so that ProbDenseInput's call and build functions can be used, but it generates other errors.

Just providing ideas, hope someone can answer, thank you very much.

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

3 participants