Home > other >  After subsplit tensorflow dataset of the training set can't load
After subsplit tensorflow dataset of the training set can't load

Time:09-20

https://tensorflow.google.cn/tutorials/keras/text_classification_with_hub? Hl=useful - cn
According to the official tutorials, practice using Keras and Tensorflow Hub to text classification of movie reviews, copy the sample code in

Train_validation_split=TFDS. Split. "TRAIN". Subsplit ([6, 4])

(train_data validation_data), test_data=https://bbs.csdn.net/topics/tfds.load (
Name="imdb_reviews,"
The split=(train_validation_split, TFDS. Split. TEST),
As_supervised=True)

Run would AssertionError error: Unrecognized instruction format: NamedSplit (' train ') (TFDS) percent [0-6 0])
Hint at the time of the load split=(train_validation_split, TFDS. Split. TEST) parameter wrong format
Checked all sorts of materials are not find the answer, there is a great god knows

CodePudding user response:

Does anyone know ah, this problem was

CodePudding user response:

How are you, I also encountered this problem, see the source code, because the download download network fluctuations that caused incomplete, TFDS cannot breakpoint under heavy, have been read error information

Solution: to download manually locate the data set and then delete the weight

CodePudding user response:

D: \ Anaconda3 \ envs \ tensorflow \ python exe D:/project/tensorflowdemo/TF_hub py
Version: 2.0.0
Eager mode: True
The Hub version: 0.7.0
The GPU is NOT AVAILABLE
(NamedSplit (' train ') (TFDS. Percent [0-6 0]), NamedSplit (' train ') (TFDS) percent [60 s: 100]))
Downloading and preparing the dataset imdb_reviews (MiB) 80.23 to C: \ Users \ Bernard \ tensorflow_datasets \ imdb_reviews \ plain_text \ 1.0.0...


Dl Completed... Url: 0 00:00,? The url/s
Dl Size... : 0 MiB 00:00, MiB/s
Dl Completed... Url: 0 00:00,? The url/s
0/25000 [0% | | 00:00 & lt;? And? Examples/s] Shuffling and writing examples to C: \ Users \ Bernard \ tensorflow_datasets \ imdb_reviews \ plain_text \ 1.0.0 incompleteH4K97W \ imdb_reviews - "train" tfrecord
0/25000 [0% | | 00:00 & lt;? And? Examples/s] Shuffling and writing examples to C: \ Users \ Bernard \ tensorflow_datasets \ imdb_reviews \ plain_text \ 1.0.0 incompleteH4K97W \ imdb_reviews - test tfrecord
0/50000 [0% | | 00:00 & lt;? And? Examples/s] Shuffling and writing examples to C: \ Users \ Bernard \ tensorflow_datasets \ imdb_reviews \ plain_text \ 1.0.0 incompleteH4K97W \ imdb_reviews - unsupervised tfrecord
Traceback (the most recent call last) :
The Dataset imdb_reviews downloaded and prepared to C: \ Users \ Bernard \ tensorflow_datasets \ imdb_reviews \ plain_text \ 1.0.0. Subsequent calls will reuse this data.
The File "D:/project/tensorflowdemo/TF_hub py", line 22, in & lt; module>
As_supervised=True)
The File "D: \ Anaconda3 \ envs \ tensorflow \ lib \ site - packages \ tensorflow_datasets \ core \ api_utils py", line 52, in disallow_positional_args_dec
Return fn (* args, * * kwargs)
The File "D: \ Anaconda3 \ envs \ tensorflow \ lib \ site - packages \ tensorflow_datasets \ core \ registered py", line 318, the load in
Ds=dbuilder. As_dataset as_dataset_kwargs (* *)
The File "D: \ Anaconda3 \ envs \ tensorflow \ lib \ site - packages \ tensorflow_datasets \ core \ api_utils py", line 52, in disallow_positional_args_dec
Return fn (* args, * * kwargs)
The File "D: \ Anaconda3 \ envs \ tensorflow \ lib \ site - packages \ tensorflow_datasets \ core \ dataset_builder py", line 476, in as_dataset
Datasets=utils. Map_nested (build_single_dataset, split, map_tuple=True)
The File "D: \ Anaconda3 \ envs \ tensorflow \ lib \ site - packages \ tensorflow_datasets \ core \ utils \ py_utils py", line 153, in map_nested
In the for v data_struct]
The File "D: \ Anaconda3 \ envs \ tensorflow \ lib \ site - packages \ tensorflow_datasets \ core \ utils \ py_utils py", line 153, in & lt; Listcomp>
In the for v data_struct]
The File "D: \ Anaconda3 \ envs \ tensorflow \ lib \ site - packages \ tensorflow_datasets \ core \ utils \ py_utils py", line 153, in map_nested
In the for v data_struct]
The File "D: \ Anaconda3 \ envs \ tensorflow \ lib \ site - packages \ tensorflow_datasets \ core \ utils \ py_utils py", line 153, in & lt; Listcomp>
In the for v data_struct]
The File "D: \ Anaconda3 \ envs \ tensorflow \ lib \ site - packages \ tensorflow_datasets \ core \ utils \ py_utils py", line 159, in map_nested
Return the function (data_struct)
The File "D: \ Anaconda3 \ envs \ tensorflow \ lib \ site - packages \ tensorflow_datasets \ core \ dataset_builder py", line 544, in _build_single_dataset
Read_config=read_config,
The File "D: \ Anaconda3 \ envs \ tensorflow \ lib \ site - packages \ tensorflow_datasets \ core \ dataset_builder py", line 901, in _as_dataset
Shuffle_files=shuffle_files,
The File "D: \ Anaconda3 \ envs \ tensorflow \ lib \ site - packages \ tensorflow_datasets \ core \ tfrecords_reader py", line 246, in the read
Datasets=utils. Map_nested (read_instruction, instructions, map_tuple=True)
The File "D: \ Anaconda3 \ envs \ tensorflow \ lib \ site - packages \ tensorflow_datasets \ core \ utils \ py_utils py", line 159, in map_nested
Return the function (data_struct)
The File "D: \ Anaconda3 \ envs \ tensorflow \ lib \ site - packages \ tensorflow_datasets \ core \ tfrecords_reader py", line 140, in _read_single_instruction
Instruction=ReadInstruction. From_spec (instruction)
The File "D: \ Anaconda3 \ envs \ tensorflow \ lib \ site - packages \ tensorflow_datasets \ core \ tfrecords_reader py", line 438, in from_spec
Instruction=_str_to_relative_instruction (subs [0])
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related