tensorflow / datasets

TFDS is a collection of datasets ready to use with TensorFlow, Jax, ...
https://www.tensorflow.org/datasets
Apache License 2.0
4.28k stars 1.53k forks source link

ValueError(f'Shapes {shape1} and {shape2} must have the same rank') #4904

Closed conceptofmind closed 2 months ago

conceptofmind commented 1 year ago

Short description

    raise ValueError(f'Shapes {shape1} and {shape2} must have the same rank')
ValueError: Failed to encode example:
{'id': '7ba1e8f4261d3170fcf42e84a81dd749116fae95', 'title': 'Brain', 'context': 'Another approach to brain function is to examine the consequences of damage to specific brain areas. Even though it is protected by the skull and meninges, surrounded by cerebrospinal fluid, and isolated from the bloodstream by the blood–brain barrier, the delicate nature of the brain makes it vulnerable to numerous diseases and several types of damage. In humans, the effects of strokes and other types of brain damage have been a key source of information about brain function. Because there is no ability to experimentally control the nature of the damage, however, this information is often difficult to interpret. In animal studies, most commonly involving rats, it is possible to use electrodes or locally injected chemicals to produce precise patterns of damage and then examine the consequences for behavior.', 'question': 'What sare the benifts of the blood brain barrir?', 'answers': [{'text': ['isolated from the bloodstream'], 'answer_start': [195]}], 'metadata': {'split': 'train', 'model_in_the_loop': 'Combined'}}
In <Sequence> with name "answers":
In <Scalar> with name "text":
Shapes (1,) and () must have the same rank

Environment information

Reproduction instructions

import tensorflow as tf
import tensorflow_datasets as tfds
ds = tfds.load('huggingface:adversarial_qa/adversarialQA')

Expected behavior Load the tensorflow dataset.

OmkarBorhade98 commented 1 year ago

Hi @conceptofmind , I was able to reproduce this issue on Google Colab. However, after installing last tfds-nightly package the error got fixed.