We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Sequences features sometimes causes errors when the specified length is not -1
import numpy as np from datasets import Features, ClassLabel, Sequence, Value, Dataset feats = Features(**{'target': ClassLabel(names=[0, 1]),'x': Sequence(feature=Value(dtype='float64',id=None), length=2, id=None)}) Dataset.from_dict({"target": np.ones(2000).astype(int), "x": np.random.rand(2000,2)},features = feats).flatten_indices()
Throws:
TypeError: Couldn't cast array of type fixed_size_list<item: double>[2] to Sequence(feature=Value(dtype='float64', id=None), length=2, id=None)
The same code works without any issues when length = -1
length = -1
EDIT: The error seems to happen only when the length of the dataset is bigger than 1000 for some reason
No exception
datasets
The text was updated successfully, but these errors were encountered:
FixedSizeListArray
Thanks for reporting! I've opened a PR with a fix.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Describe the bug
Sequences features sometimes causes errors when the specified length is not -1
Steps to reproduce the bug
Throws:
The same code works without any issues when
length = -1
EDIT: The error seems to happen only when the length of the dataset is bigger than 1000 for some reason
Expected behavior
No exception
Environment info
datasets
version: 2.10.1The text was updated successfully, but these errors were encountered: