[텐서플로2] 파이썬 딥러닝 완전정복 - GAN, BERT, RNN, CNN 최신기법

[텐서플로2] 파이썬 딥러닝 완전정복 - GAN, BERT, RNN, CNN 최신기법

heejoonk5 프로필

deprecated 가 의심되는 코드 하나 더 여쭙겠습니다 heejoonk5 1달 전
예제 22 IMDB_RNN.py  에서 train_dataset = train_dataset.shuffle(BUFFER_SIZE) train_dataset = train_dataset.padded_batch(BATCH_SIZE,  train_dataset.output_shapes)) test_dataset = test_dataset.padded_batch(BATCH_SIZE,  test_dataset.output_shapes) 이 부분에 train_dataset.output_shapes  와 test_dataset.output_shapes 가 에러입니다 에러 메세지는 다음과 같습니다'ShuffleDataset' object has no attribute 'output_shapes'이부분... 구글 colab 에서는 약간의 경고 메세지와 함께 실행은 되는데주피터 노트북에서는 위와 같은 에러가 납니다죄송하지만 이거 하나더 부탁드리겠습니다

1
heejoonk5 프로필

IMDB data 소스 코드 에러 사항 heejoonk5 1달 전
train_validation_split = tfds.Split.TRAIN.subsplit([6, 4])이 문장에서 'Split' object has no attribute 'subsplit'이 같은 에러가 나옵니다

2
한병식 프로필

자료와 예제코드 한병식 3달 전
교육 교제와 예제코드는 어디있나요 . . 여기서는 찾을 수가 없네요  

1
gara44 프로필

LSTM관련하여 질문드릴 수 있을까요....? gara44 3달 전
Keras를 활용하여 LSTM 학습을 하는중입력값을 판단하기 어려운 부분이 있어 질문드립니다.model = Sequential() model.add(LSTM(128, batch_input_shape=(1, 4, 1), stateful=True)) model.add(Dense(12, activation='softmax')) 이처럼 구현할때 LSTM(128 부분의 128과, Dense(12 의 12가 무슨 의미인지 알 수 있을까요?

1
송정현 프로필

다음을 실행하면 에러가 납니다. 송정현 5달 전
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])

1
지식공유자 되기
많은 사람들에게 배움의 기회를 주고,
경제적 보상을 받아보세요.
지식공유참여
기업 교육을 위한 인프런
“인프런 비즈니스” 를 통해 모든 팀원이 인프런의 강의들을
자유롭게 학습하는 환경을 제공하세요.
인프런 비즈니스