datasets icon indicating copy to clipboard operation
datasets copied to clipboard

OverflowError when importing tensorflow-datasets version 4.5.0

Open rendicahya opened this issue 4 years ago • 7 comments

---------------------------------------------------------------------------
OverflowError                             Traceback (most recent call last)
Input In [5], in <module>
----> 1 import tensorflow_datasets as tfds

File D:\JupyterLabNotebooks\tensorflow-course-udacity\venv\lib\site-packages\tensorflow_datasets\__init__.py:65, in <module>
     63 from tensorflow_datasets import translate
     64 from tensorflow_datasets import video
---> 65 from tensorflow_datasets import vision_language
     68 # Public API to create and generate a dataset
     69 from tensorflow_datasets.public_api import *  # pylint: disable=wildcard-import

File D:\JupyterLabNotebooks\tensorflow-course-udacity\venv\lib\site-packages\tensorflow_datasets\vision_language\__init__.py:21, in <module>
     19 from tensorflow_datasets.vision_language.grounded_scan import GroundedScan
     20 from tensorflow_datasets.vision_language.refcoco import RefCoco
---> 21 from tensorflow_datasets.vision_language.wit import Wit
     22 from tensorflow_datasets.vision_language.wit_kaggle import WitKaggle

File D:\JupyterLabNotebooks\tensorflow-course-udacity\venv\lib\site-packages\tensorflow_datasets\vision_language\wit\__init__.py:18, in <module>
      1 # coding=utf-8
      2 # Copyright 2022 The TensorFlow Datasets Authors.
      3 #
   (...)
     13 # See the License for the specific language governing permissions and
     14 # limitations under the License.
     16 """wit dataset."""
---> 18 from tensorflow_datasets.vision_language.wit.wit import Wit

File D:\JupyterLabNotebooks\tensorflow-course-udacity\venv\lib\site-packages\tensorflow_datasets\vision_language\wit\wit.py:25, in <module>
     22 import tensorflow as tf
     23 import tensorflow_datasets.public_api as tfds
---> 25 csv.field_size_limit(sys.maxsize)
     27 _DESCRIPTION = """
     28 Wikipedia-based Image Text (WIT) Dataset is a large multimodal multilingual
     29 dataset. WIT is composed of a curated set of 37.6 million entity rich image-text
   (...)
     32 learning models.
     33 """
     35 _CITATION = """
     36 @article{srinivasan2021wit,
     37   title={WIT: Wikipedia-based Image Text Dataset for Multimodal Multilingual Machine Learning},
   (...)
     41 }
     42 """

OverflowError: Python int too large to convert to C long

Short description OverflowError occurs when importing tensorflow-datasets 4.5.0. Can be easily fixed by downgrading to 4.4.0.

Environment information

  • Operating System: Windows

  • Python version: 3.9.10

  • tensorflow-datasets/tfds-nightly version: 4.5.0

  • tensorflow/tf-nightly version: 2.7.0

  • Does the issue still exists with the last tfds-nightly package (pip install --upgrade tfds-nightly) ?

Reproduction instructions

import tensorflow_datasets as tfds

rendicahya avatar Jan 26 '22 11:01 rendicahya

Thank you @rendicahya and @zhiltsov-max for raising this issue!

Pull #3710 should have fixed this problem.

ccl-core avatar Jan 27 '22 17:01 ccl-core

I have the same error in windows. Installing master didn't solve the problem.


OverflowError Traceback (most recent call last) Input In [1], in 1 import tensorflow as tf ----> 3 import tensorflow_datasets as tfds

File ~\AppData\Roaming\Python\Python39\site-packages\tensorflow_datasets_init_.py:65, in 63 from tensorflow_datasets import translate 64 from tensorflow_datasets import video ---> 65 from tensorflow_datasets import vision_language 68 # Public API to create and generate a dataset 69 from tensorflow_datasets.public_api import * # pylint: disable=wildcard-import

File ~\AppData\Roaming\Python\Python39\site-packages\tensorflow_datasets\vision_language_init_.py:21, in 19 from tensorflow_datasets.vision_language.grounded_scan import GroundedScan 20 from tensorflow_datasets.vision_language.refcoco import RefCoco ---> 21 from tensorflow_datasets.vision_language.wit import Wit 22 from tensorflow_datasets.vision_language.wit_kaggle import WitKaggle

File ~\AppData\Roaming\Python\Python39\site-packages\tensorflow_datasets\vision_language\wit_init_.py:18, in 1 # coding=utf-8 2 # Copyright 2022 The TensorFlow Datasets Authors. 3 # (...) 13 # See the License for the specific language governing permissions and 14 # limitations under the License. 16 """wit dataset.""" ---> 18 from tensorflow_datasets.vision_language.wit.wit import Wit

File ~\AppData\Roaming\Python\Python39\site-packages\tensorflow_datasets\vision_language\wit\wit.py:25, in 22 import tensorflow_datasets.public_api as tfds 24 # Limit to 100 MB. Value must be smaller than the C long maximum value. ---> 25 csv.field_size_limit(100 * 1024**3) 27 _DESCRIPTION = """ 28 Wikipedia-based Image Text (WIT) Dataset is a large multimodal multilingual 29 dataset. WIT is composed of a curated set of 37.6 million entity rich image-text (...) 32 learning models. 33 """ 35 _CITATION = """ 36 @article{srinivasan2021wit, 37 title={WIT: Wikipedia-based Image Text Dataset for Multimodal Multilingual Machine Learning}, (...) 41 } 42 """

OverflowError: Python int too large to convert to C long

Environment information

  • OS: Windows
  • Python: 3.9.9
  • tensorflow: 2.7.0

dacalin avatar Jan 28 '22 13:01 dacalin

Sorry for the breakage. We'll send a fix and update to 4.5.1 as soon as possible.

Conchylicultor avatar Jan 28 '22 18:01 Conchylicultor

4.5.1 version has been released. It should have fixed the issue. Let us know if you still encounter issues after updating.

Conchylicultor avatar Jan 31 '22 12:01 Conchylicultor

Hi, we still can see this problem https://github.com/openvinotoolkit/datumaro/runs/5006795500?check_suite_focus=true

Successfully installed GitPython-3.1.26 Pillow-9.0.0 PyYAML-6.0 absl-py-1.0.0 aiohttp-3.8.1 aiohttp-retry-2.4.6 aiosignal-1.2.0 appdirs-1.4.4 astunparse-1.6.3 async-timeout-4.0.2 asyncssh-2.8.1 atomicwrites-1.4.0 atpublic-3.0.1 attrs-21.4.0 cachetools-5.0.0 certifi-2021.10.8 cffi-1.15.0 charset-normalizer-2.0.11 colorama-0.4.4 commonmark-0.9.1 configobj-5.0.6 cryptography-36.0.1 cycler-0.11.0 datumaro-0.2.3 defusedxml-0.7.1 dictdiffer-0.9.0 dill-0.3.4 diskcache-5.4.0 distro-1.6.0 dpath-2.0.5 dulwich-0.20.32 dvc-2.9.3 flatbuffers-2.0 flatten-dict-0.4.2 flufl.lock-7.0 fonttools-4.29.0 frozenlist-1.3.0 fsspec-2022.1.0 ftfy-6.0.3 funcy-1.17 future-0.18.2 gast-0.4.0 gitdb-4.0.9 google-auth-2.5.0 google-auth-oauthlib-0.4.6 google-pasta-0.2.0 googleapis-common-protos-1.54.0 grandalf-0.6 grpcio-1.43.0 h5py-3.6.0 idna-3.3 importlib-metadata-4.10.1 iniconfig-1.1.1 keras-2.7.0 keras-preprocessing-1.1.2 kiwisolver-1.3.2 libclang-13.0.0 lxml-4.7.1 mailchecker-4.1.10 markdown-3.3.6 matplotlib-3.5.1 multidict-6.0.2 nanotime-0.5.2 networkx-2.6.3 numpy-1.22.1 oauthlib-3.2.0 opencv-python-4.5.5.62 openvino-telemetry-2022.1.0 opt-einsum-3.3.0 packaging-21.3 pandas-1.4.0 pathspec-0.9.0 phonenumbers-8.12.42 pluggy-1.0.0 ply-3.11 promise-2.3 protobuf-3.19.4 psutil-5.9.0 py-1.11.0 pyasn1-0.4.8 pyasn1-modules-0.2.8 pycocotools-2.0.4 pycparser-2.21 pydot-1.4.2 pygit2-1.7.2 pygments-2.11.2 pygtrie-2.4.2 pyparsing-3.0.7 pytest-6.2.5 python-benedict-0.24.3 python-dateutil-2.8.2 python-fsutil-0.6.0 python-slugify-5.0.2 pytz-2021.3 requests-2.27.1 requests-oauthlib-1.3.1 rich-11.1.0 rsa-4.8 ruamel.yaml-0.17.20 ruamel.yaml.clib-0.2.6 scipy-1.7.3 scmrepo-0.0.7 shortuuid-1.0.8 shtab-1.5.3 six-1.16.0 smmap-5.0.0 tabulate-0.8.9 tensorboard-2.8.0 tensorboard-data-server-0.6.1 tensorboard-plugin-wit-1.8.1 tensorboardX-2.4.1 tensorflow-2.7.0 tensorflow-datasets-4.5.1 tensorflow-estimator-2.7.0 tensorflow-io-gcs-filesystem-0.23.1 tensorflow-metadata-1.6.0 termcolor-1.1.0 text-unidecode-1.3 toml-0.10.2 tqdm-4.62.3 typing-extensions-4.0.1 urllib3-1.26.8 voluptuous-0.12.2 wcwidth-0.2.5 werkzeug-2.0.2 wheel-0.37.1 wrapt-1.13.3 xmltodict-0.12.0 yarl-1.7.2 zc.lockfile-2.0 zipp-3.7.0

zhiltsov-max avatar Jan 31 '22 14:01 zhiltsov-max

Sorry for the issue, indeed it looks like the issue appear in 2 places and we only fix one of the files. We're working on releasing 4.5.2 now (hopefully it will work now)

Conchylicultor avatar Jan 31 '22 14:01 Conchylicultor

https://pypi.org/project/tensorflow-datasets/ is now at 4.5.2 and should contain the https://github.com/tensorflow/datasets/commit/68fa6da5a700f58c764c1cc9990e7a3938a1cae0 fix. Let us know if you're still encountering the issue

Conchylicultor avatar Jan 31 '22 15:01 Conchylicultor