Ошибка при использовании tfds.load в наборе данных Tensorflow - PullRequest
1 голос
/ 13 июля 2020

Мне было интересно, есть ли проблема с набором данных tensorflow 2.2 в выпуске Windows.

Вот моя диагностика c код

import numpy as np
import tensorflow as tf
import tensorflow_hub as hub
import tensorflow_datasets as tfds

print("Version: ", tf.__version__)
print("Eager mode: ", tf.executing_eagerly())
print("Hub version: ", hub.__version__)
print("GPU is", "available" if tf.config.experimental.list_physical_devices("GPU") else "NOT AVAILABLE")
Version:  2.2.0
Eager mode:  True
Hub version:  0.8.0
GPU is available

Я могу загрузить список наборов данных

tfds.list_builders()
['abstract_reasoning',
 'aeslc',
 'aflw2k3d',
 'amazon_us_reviews',
 'anli',
 .
 .
 .
 'xnli',
 'xsum',
 'yelp_polarity_reviews']

Однако я не могу загрузить какой-либо набор данных

imdb, info = tfds.load('imdb_reviews', with_info=True, as_supervised=True)

Я получаю следующие ошибки:

---------------------------------------------------------------------------
UnimplementedError                        Traceback (most recent call last)
c:\python37\lib\site-packages\tensorflow_datasets\core\utils\py_utils.py in try_reraise(*args, **kwargs)
    398   try:
--> 399     yield
    400   except Exception:   # pylint: disable=broad-except

c:\python37\lib\site-packages\tensorflow_datasets\core\registered.py in builder(name, **builder_init_kwargs)
    243       prefix="Failed to construct dataset {}".format(name)):
--> 244     return builder_cls(name)(**builder_kwargs)
    245 

c:\python37\lib\site-packages\wrapt\wrappers.py in __call__(self, *args, **kwargs)
    602             return self._self_wrapper(self.__wrapped__, self._self_instance,
--> 603                     args, kwargs)
    604 

c:\python37\lib\site-packages\tensorflow_datasets\core\api_utils.py in disallow_positional_args_dec(fn, instance, args, kwargs)
     68     _check_required(fn, kwargs)
---> 69     return fn(*args, **kwargs)
     70 

c:\python37\lib\site-packages\tensorflow_datasets\core\dataset_builder.py in __init__(self, data_dir, config, version)
    205     else:  # Use the code version (do not restore data)
--> 206       self.info.initialize_from_bucket()
    207 

c:\python37\lib\site-packages\tensorflow_datasets\core\dataset_info.py in initialize_from_bucket(self)
    422     tmp_dir = tempfile.mkdtemp("tfds")
--> 423     data_files = gcs_utils.gcs_dataset_info_files(self.full_name)
    424     if not data_files:

c:\python37\lib\site-packages\tensorflow_datasets\core\utils\gcs_utils.py in gcs_dataset_info_files(dataset_dir)
     69   """Return paths to GCS files in the given dataset directory."""
---> 70   return gcs_listdir(posixpath.join(GCS_DATASET_INFO_DIR, dataset_dir))
     71 

c:\python37\lib\site-packages\tensorflow_datasets\core\utils\gcs_utils.py in gcs_listdir(dir_name)
     62   root_dir = gcs_path(dir_name)
---> 63   if _is_gcs_disabled or not tf.io.gfile.exists(root_dir):
     64     return None

c:\python37\lib\site-packages\tensorflow\python\lib\io\file_io.py in file_exists_v2(path)
    266   try:
--> 267     _pywrap_file_io.FileExists(compat.as_bytes(path))
    268   except errors.NotFoundError:

UnimplementedError: File system scheme 'gs' not implemented (file: 'gs://tfds-data/dataset_info/imdb_reviews/plain_text/1.0.0')

During handling of the above exception, another exception occurred:

TypeError                                 Traceback (most recent call last)
<ipython-input-36-06930b64f980> in <module>
      1 #tfds.list_builders()
----> 2 imdb, info = tfds.load('imdb_reviews', with_info=True, as_supervised=True)

c:\python37\lib\site-packages\wrapt\wrappers.py in __call__(self, *args, **kwargs)
    562 
    563         return self._self_wrapper(self.__wrapped__, self._self_instance,
--> 564                 args, kwargs)
    565 
    566 class BoundFunctionWrapper(_FunctionWrapperBase):

c:\python37\lib\site-packages\tensorflow_datasets\core\api_utils.py in disallow_positional_args_dec(fn, instance, args, kwargs)
     67     _check_no_positional(fn, args, ismethod, allowed=allowed)
     68     _check_required(fn, kwargs)
---> 69     return fn(*args, **kwargs)
     70 
     71   return disallow_positional_args_dec(wrapped)  # pylint: disable=no-value-for-parameter

c:\python37\lib\site-packages\tensorflow_datasets\core\registered.py in load(name, split, data_dir, batch_size, shuffle_files, download, as_supervised, decoders, read_config, with_info, builder_kwargs, download_and_prepare_kwargs, as_dataset_kwargs, try_gcs)
    366     data_dir = constants.DATA_DIR
    367 
--> 368   dbuilder = builder(name, data_dir=data_dir, **builder_kwargs)
    369   if download:
    370     download_and_prepare_kwargs = download_and_prepare_kwargs or {}

c:\python37\lib\site-packages\tensorflow_datasets\core\registered.py in builder(name, **builder_init_kwargs)
    242   with py_utils.try_reraise(
    243       prefix="Failed to construct dataset {}".format(name)):
--> 244     return builder_cls(name)(**builder_kwargs)
    245 
    246 

c:\python37\lib\contextlib.py in __exit__(self, type, value, traceback)
    128                 value = type()
    129             try:
--> 130                 self.gen.throw(type, value, traceback)
    131             except StopIteration as exc:
    132                 # Suppress StopIteration *unless* it's the same exception that

c:\python37\lib\site-packages\tensorflow_datasets\core\utils\py_utils.py in try_reraise(*args, **kwargs)
    399     yield
    400   except Exception:   # pylint: disable=broad-except
--> 401     reraise(*args, **kwargs)
    402 
    403 

c:\python37\lib\site-packages\tensorflow_datasets\core\utils\py_utils.py in reraise(prefix, suffix)
    390   suffix = '\n' + suffix if suffix else ''
    391   msg = prefix + str(exc_value) + suffix
--> 392   six.reraise(exc_type, exc_type(msg), exc_traceback)
    393 
    394 

TypeError: __init__() missing 2 required positional arguments: 'op' and 'message'

Не работает ли библиотека ? Как уже упоминалось, я использую Windows 10 машину и использую Jupyter Lab .

1 Ответ

0 голосов
/ 22 июля 2020

После публикации проблемы на Github , проблема была исправлена ​​в 3.2.1

...