OverflowError: Python int too large to convert to C long torchtext.datasets.text_classification.DATASETS['AG_NEWS']() OverflowError: Python int too large to convert to C long torchtext.datasets.text_classification.DATASETS['AG_NEWS']() windows windows

OverflowError: Python int too large to convert to C long torchtext.datasets.text_classification.DATASETS['AG_NEWS']()


I also encountered a similar problem. I changed a line of code in my torchtext\utils.py file and my error disappeared.

Changed this:

csv.field_size_limit(sys.maxsize)

To this:

csv.field_size_limit(maxInt)