Pycharm 使用 tensorflow_datasets 錯誤 【Failed to construct dataset ...】
阿新 • • 發佈:2021-01-23
技術標籤:TensorFlowpythonpycharmtensorflow
tensorflow-datasets 版本 : 2.1.0
import tensorflow_datasets as tfds
datasets, info = tfds.load('imdb_reviews/subwords8k', with_info=True, as_supervised=True)
報錯:Failed to construct datasetimdb_reviews
增加一行程式碼即可:
_is_gcs_disabled = False
tfds.load( ) 還可以新增的引數:
Some common arguments:
split=
: Which split to read (e.g.'train'
,['train', 'test']
,'train[80%:]'
,...). See oursplit API guide.shuffle_files=
: Control whether to shuffle the files between each epoch (TFDS store big datasets in multiple smaller files).data_dir=
: Location where the dataset is saved ( defaults to~/tensorflow_datasets/
~/tensorflow_datasets/
with_info=True
: Returns thetfds.core.DatasetInfo
containing dataset metadatadownload=False
: Disable download, 如果本地存在,可以直接讀取,不下載