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

Layer softmax was called with an input that isn't a symbolic tensor. #8

Open
kapilg1997 opened this issue Dec 12, 2019 · 0 comments
Open

Comments

@kapilg1997
Copy link

Windows 10
Python: 3.7.5
tensorflow: 2.0.0
Keras: 2.3.1

model_1 = rnn_model(input_dim=13, # change to 13 if you would like to use MFCC features
units=200,
activation='relu')

This error occurrs


ValueError Traceback (most recent call last)
~\AppData\Roaming\Python\Python37\site-packages\keras\engine\base_layer.py in assert_input_compatibility(self, inputs)
309 try:
--> 310 K.is_keras_tensor(x)
311 except ValueError:

~\AppData\Roaming\Python\Python37\site-packages\keras\backend\tensorflow_backend.py in is_keras_tensor(x)
696 raise ValueError('Unexpectedly found an instance of type ' + --> 697 str(type(x)) + '. '
698 'Expected a symbolic tensor instance.')

ValueError: Unexpectedly found an instance of type <class 'ellipsis'>. Expected a symbolic tensor instance.

During handling of the above exception, another exception occurred:

ValueError Traceback (most recent call last)
in
1 model_1 = rnn_model(input_dim=13, # change to 13 if you would like to use MFCC features
2 units=200,
----> 3 activation='relu')

~\STT\AIND-VUI-Capstone\sample_models.py in rnn_model(input_dim, units, activation, output_dim)
33 time_dense = ...
34 # Add softmax activation layer
---> 35 y_pred = Activation('softmax', name='softmax')(time_dense)
36 # Specify the model
37 model = Model(inputs=input_data, outputs=y_pred)

~\AppData\Roaming\Python\Python37\site-packages\keras\backend\tensorflow_backend.py in symbolic_fn_wrapper(*args, **kwargs)
73 if _SYMBOLIC_SCOPE.value:
74 with get_graph().as_default():
---> 75 return func(*args, **kwargs)
76 else:
77 return func(*args, **kwargs)

~\AppData\Roaming\Python\Python37\site-packages\keras\engine\base_layer.py in call(self, inputs, **kwargs)
444 # Raise exceptions in case the input is not compatible
445 # with the input_spec specified in the layer constructor.
--> 446 self.assert_input_compatibility(inputs)
447
448 # Collect input shapes to build layer.

~\AppData\Roaming\Python\Python37\site-packages\keras\engine\base_layer.py in assert_input_compatibility(self, inputs)
314 'Received type: ' +
315 str(type(x)) + '. Full input: ' +
--> 316 str(inputs) + '. All inputs to the layer '
317 'should be tensors.')
318

ValueError: Layer softmax was called with an input that isn't a symbolic tensor. Received type: <class 'ellipsis'>. Full input: [Ellipsis]. All inputs to the layer should be tensors.

I have made necessary changes to accommodate newer versions of tensorflow, keras and such

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