다음을 실행하면 에러가 납니다.
1184
9 câu hỏi đã được viết
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
import tensorflow as tf
import tensorflow_hub as hub
import tensorflow_datasets as tfds
train_validation_split = tfds.Split.TRAIN.subsplit([6, 4])
(train_data, validation_data), test_data = tfds.load(
name="imdb_reviews",
split=(train_validation_split, tfds.Split.TEST),
as_supervised=True)
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.0.0 Eager mode: True Hub version: 0.7.0 GPU is NOT AVAILABLE
다음과 같은 에러가 납니다.
--------------------------------------------------------------------------- AssertionError Traceback (most recent call last) <ipython-input-6-55c5f5ff433f> in <module> 6 name="imdb_reviews", 7 split=(train_validation_split, tfds.Split.TEST), ----> 8 as_supervised=True) ~\Anaconda3\envs\jhsong37\lib\site-packages\tensorflow_datasets\core\api_utils.py in disallow_positional_args_dec(fn, instance, args, kwargs) 50 _check_no_positional(fn, args, ismethod, allowed=allowed) 51 _check_required(fn, kwargs) ---> 52 return fn(*args, **kwargs) 53 54 return disallow_positional_args_dec(wrapped) # pylint: disable=no-value-for-parameter ~\Anaconda3\envs\jhsong37\lib\site-packages\tensorflow_datasets\core\registered.py in load(name, split, data_dir, batch_size, in_memory, shuffle_files, download, as_supervised, decoders, read_config, with_info, builder_kwargs, download_and_prepare_kwargs, as_dataset_kwargs, try_gcs) 316 as_dataset_kwargs.setdefault("read_config", read_config) 317 --> 318 ds = dbuilder.as_dataset(**as_dataset_kwargs) 319 if with_info: 320 return ds, dbuilder.info ~\Anaconda3\envs\jhsong37\lib\site-packages\tensorflow_datasets\core\api_utils.py in disallow_positional_args_dec(fn, instance, args, kwargs) 50 _check_no_positional(fn, args, ismethod, allowed=allowed) 51 _check_required(fn, kwargs) ---> 52 return fn(*args, **kwargs) 53 54 return disallow_positional_args_dec(wrapped) # pylint: disable=no-value-for-parameter ~\Anaconda3\envs\jhsong37\lib\site-packages\tensorflow_datasets\core\dataset_builder.py in as_dataset(self, split, batch_size, shuffle_files, decoders, read_config, as_supervised, in_memory) 474 in_memory=in_memory, 475 ) --> 476 datasets = utils.map_nested(build_single_dataset, split, map_tuple=True) 477 return datasets 478 ~\Anaconda3\envs\jhsong37\lib\site-packages\tensorflow_datasets\core\utils\py_utils.py in map_nested(function, data_struct, dict_only, map_tuple) 151 if isinstance(data_struct, tuple(types)): 152 mapped = [map_nested(function, v, dict_only, map_tuple) --> 153 for v in data_struct] 154 if isinstance(data_struct, list): 155 return mapped ~\Anaconda3\envs\jhsong37\lib\site-packages\tensorflow_datasets\core\utils\py_utils.py in <listcomp>(.0) 151 if isinstance(data_struct, tuple(types)): 152 mapped = [map_nested(function, v, dict_only, map_tuple) --> 153 for v in data_struct] 154 if isinstance(data_struct, list): 155 return mapped ~\Anaconda3\envs\jhsong37\lib\site-packages\tensorflow_datasets\core\utils\py_utils.py in map_nested(function, data_struct, dict_only, map_tuple) 151 if isinstance(data_struct, tuple(types)): 152 mapped = [map_nested(function, v, dict_only, map_tuple) --> 153 for v in data_struct] 154 if isinstance(data_struct, list): 155 return mapped ~\Anaconda3\envs\jhsong37\lib\site-packages\tensorflow_datasets\core\utils\py_utils.py in <listcomp>(.0) 151 if isinstance(data_struct, tuple(types)): 152 mapped = [map_nested(function, v, dict_only, map_tuple) --> 153 for v in data_struct] 154 if isinstance(data_struct, list): 155 return mapped ~\Anaconda3\envs\jhsong37\lib\site-packages\tensorflow_datasets\core\utils\py_utils.py in map_nested(function, data_struct, dict_only, map_tuple) 157 return tuple(mapped) 158 # Singleton --> 159 return function(data_struct) 160 161 ~\Anaconda3\envs\jhsong37\lib\site-packages\tensorflow_datasets\core\dataset_builder.py in _build_single_dataset(self, split, shuffle_files, batch_size, decoders, read_config, as_supervised, in_memory) 542 shuffle_files=shuffle_files, 543 decoders=decoders, --> 544 read_config=read_config, 545 ) 546 ~\Anaconda3\envs\jhsong37\lib\site-packages\tensorflow_datasets\core\dataset_builder.py in _as_dataset(self, split, decoders, read_config, shuffle_files) 899 split_infos=self.info.splits.values(), 900 read_config=read_config, --> 901 shuffle_files=shuffle_files, 902 ) 903 else: ~\Anaconda3\envs\jhsong37\lib\site-packages\tensorflow_datasets\core\tfrecords_reader.py in read(self, name, instructions, split_infos, read_config, shuffle_files) 244 name2len=name2len, name2shard_lengths=name2shard_lengths, 245 shuffle_files=shuffle_files) --> 246 datasets = utils.map_nested(read_instruction, instructions, map_tuple=True) 247 return datasets 248 ~\Anaconda3\envs\jhsong37\lib\site-packages\tensorflow_datasets\core\utils\py_utils.py in map_nested(function, data_struct, dict_only, map_tuple) 157 return tuple(mapped) 158 # Singleton --> 159 return function(data_struct) 160 161 ~\Anaconda3\envs\jhsong37\lib\site-packages\tensorflow_datasets\core\tfrecords_reader.py in _read_single_instruction(instruction, parse_fn, read_config, name, path, name2len, name2shard_lengths, shuffle_files) 138 """ 139 if not isinstance(instruction, ReadInstruction): --> 140 instruction = ReadInstruction.from_spec(instruction) 141 absolute_instructions = instruction.to_absolute(name2len) 142 files = list(itertools.chain.from_iterable([ ~\Anaconda3\envs\jhsong37\lib\site-packages\tensorflow_datasets\core\tfrecords_reader.py in from_spec(cls, spec) 436 if not subs: 437 raise AssertionError('No instructions could be built out of %s' % spec) --> 438 instruction = _str_to_relative_instruction(subs[0]) 439 return sum([_str_to_relative_instruction(sub) for sub in subs[1:]], 440 instruction) ~\Anaconda3\envs\jhsong37\lib\site-packages\tensorflow_datasets\core\tfrecords_reader.py in _str_to_relative_instruction(spec) 277 res = _SUB_SPEC_RE.match(spec) 278 if not res: --> 279 raise AssertionError('Unrecognized instruction format: %s' % spec) 280 unit = '%' if res.group('from_pct') or res.group('to_pct') else 'abs' 281 return ReadInstruction( AssertionError: Unrecognized instruction format: NamedSplit('train')(tfds.percent[0:60])
Câu trả lời 1
0
안녕하세요?
일단 해당코드가 다른 머신에서는 정상적으로 작동하고 있습니다.
그럼 사용하시는 머신에 텐서플로우 라이브러리 설치를 일단 의심해 볼 수 있습니다.
AssertionError: Unrecognized instruction format: NamedSplit('train')(tfds.percent[0:60])
일간 tensorflow_datasets 에서 에러가 발생하므로
pip uninstall tensorflow-datasets하고
다시 pip install tensorflow-datasets 하여 설치 후
머신을 재부팅하고 실행해 보세요.
문제가 해결되시길 바랍니다.
감사합니다.
MCP 이후 길을 잃었습니다.
1
26
2
smithery ai system shutdown
1
26
2
24 매도 종목 추출 API를 실행해 봤는데요.
1
26
1
Colab
0
41
2
베개 투자법 20장 - 수급팩터 코드 반영 질문입니다.
1
29
1
베개투자법 19장 sql 설치관련 질문입니다.
0
36
2
이 강의
0
46
1
1-5와 1-6이 동일한 영상입니다. 1-6이 누락되었어여
0
35
1
보안정보 질문
0
38
2
압축풀기가 완료할수 없다는메세지가 뜹니다. 물론 그냥볼수는 있으나 왜안될까요
0
25
2
한 곳이 아파도 나머지는 돌게하려는것이다.에 대해서 질문있습니다.
0
36
0
Kaggle 실행한 GPU 노트북이 5시간째 QUEUED입니다
1
69
1
지원오류
0
231
0
강의자료가 어디있나요?
0
315
0
RNN&BERT 코드 에러 질문입니다!
0
489
4
네이버 영화평 dataset 을 tfds.load 로 올린후 encoder method 까지 사용하려면?
0
505
2
코드를 그대로 돌렸는데 애로가 나오는 이유가 알고 싶습니다
0
660
1
accuracy가 훨씬 낮게 나오는 이유는 무엇인가요??
0
339
1
예제로 쓰인 코드가 어디있는지 모르겠습니다...
0
278
1
ImportError : DLL load failed
0
621
2
deprecated 가 의심되는 코드 하나 더 여쭙겠습니다
0
381
1
IMDB data 소스 코드 에러 사항
0
479
2
자료와 예제코드
0
411
1
LSTM관련하여 질문드릴 수 있을까요....?
0
3721
1

