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

Invalid dtype: complex64 #79

Open
kinyanjuiprince21 opened this issue Sep 19, 2024 · 0 comments
Open

Invalid dtype: complex64 #79

kinyanjuiprince21 opened this issue Sep 19, 2024 · 0 comments

Comments

@kinyanjuiprince21
Copy link

When I run this code:

mel_spectrogram_layer = get_melspectrogram_layer(input_shape=input_shape,
                                 n_mels=128,
                                 pad_end=True,
                                 n_fft=512,
                                 win_length=400,
                                 hop_length=160,
                                 sample_rate=SR,
                                 return_decibel=True,
                                 input_data_format='channels_last',
                                 output_data_format='channels_last')

I get this error:

usr/local/lib/python3.10/dist-packages/kapre/time_frequency.py:110: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.
  super(STFT, self).__init__(**kwargs)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
[<ipython-input-4-4c6b029c218a>](https://localhost:8080/#) in <cell line: 106>()
    119     args, _ = parser.parse_known_args()
    120 
--> 121     train(args)

8 frames
[/usr/local/lib/python3.10/dist-packages/optree/ops.py](https://localhost:8080/#) in tree_map(func, tree, is_leaf, none_is_leaf, namespace, *rests)
    745     leaves, treespec = _C.flatten(tree, is_leaf, none_is_leaf, namespace)
    746     flat_args = [leaves] + [treespec.flatten_up_to(r) for r in rests]
--> 747     return treespec.unflatten(map(func, *flat_args))
    748 
    749 

ValueError: Exception encountered when calling STFT.call().

Could not automatically infer the output shape / dtype of 'stft' (of type STFT). Either the `STFT.call()` method is incorrect, or you need to implement the `STFT.compute_output_spec() / compute_output_shape()` method. Error encountered:

Invalid dtype: complex64

Arguments received by STFT.call():
  • args=('<KerasTensor shape=(None, 16000, 1), dtype=float32, sparse=None, name=keras_tensor>',)
  • kwargs=<class 'inspect._empty'>
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