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

InvalidArgumentError: Can not squeeze dim[1], expected a dimension of 1, got 2 #1

Open
Nelokaby opened this issue Aug 9, 2022 · 1 comment

Comments

@Nelokaby
Copy link

Nelokaby commented Aug 9, 2022

Hello Sir,

i got error while i am build your code in our dataset.
i followed all step and every thing work fine except here

`for batch in train_dataset.take(10):
print(batch)
label_tokens = batch[1][1]

print(label_tokens)
label = tf.strings.reduce_join(num_to_char(label_tokens)).numpy().decode("utf-8")
print(label)`

i got this error

`---------------------------------------------------------------------------
InvalidArgumentError Traceback (most recent call last)
in ()
----> 1 for batch,x,y in train_dataset.take(10):
2 print(batch)
3 label_tokens = batch[1][1]
4
5 print(label_tokens)

3 frames
/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/ops.py in raise_from_not_ok_status(e, name)
7162 def raise_from_not_ok_status(e, name):
7163 e.message += (" name: " + name if name is not None else "")
-> 7164 raise core._status_to_exception(e) from None # pylint: disable=protected-access
7165
7166

InvalidArgumentError: Can not squeeze dim[1], expected a dimension of 1, got 2
[[{{node Squeeze}}]] [Op:IteratorGetNext]`

@to-schi
Copy link
Owner

to-schi commented Aug 10, 2022

Hi! There are some lines of the error message missing.

The metadata has to be in the form of 1 file_path (*.flac-file) and 1 transcription (string) per sample:

| file_path | transcription |
| ./.../sample*.flac | text with lower case characters in characters-list |
| ... | ... |

(The new version of tensorflow-io does not work!
Try "!pip install tensorflow-io==0.25"
)

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

2 participants