묻고 답해요
160만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결파이썬을 활용한 머신러닝 딥러닝 입문
섹션9 First Autoencoder 인코더, 디코더 모델 생성 오류 해결 방법
강의 14분쯤에서 모델을 변경하는 부분입니다.케라스가 업데이트 된 건지는 잘 모르겠지만 아래 부분에서 시퀀셜 모델이 레이어를 단일 값으로 받을 수 없어 에러가 납니다.encoder = Sequential(Dense(2, input_shape=(3, ))) decoder = Sequential(Dense(3, input_shape=(2, ))) autoencoder = Sequential([encoder, decoder]) autoencoder.summary()아래 처럼 괄호로 감싸 리스트로 넘기면 해결됩니다.encoder = Sequential([Dense(2, input_shape=(3, ))]) decoder = Sequential([Dense(3, input_shape=(2, ))]) autoencoder = Sequential([encoder, decoder]) autoencoder.summary()
-
미해결딥러닝을 활용한 자연어 처리 (NLP) 과정 (기초부터 ChatGPT/생성 모델까지)
패딩과 관련한 질문 드립니다.
교사학습용 데이터와 target 데이터 모두 post 패딩을 하였는데교사학습용 데이터는 <sos> 가 중요하고 target 데이터는<eos> 가 중요하기 때문에 교사학습용은 post, target 데이터는 pre 를 해야 하는거 아닌지요?만약 post 패딩을 하게 되면 길이가 초과하는 교사학습용 데이터는 <sos>가 잘려지지 않을까 생각합니다.강사님 부탁드리겠습니다.
-
미해결예제로 배우는 딥러닝 자연어 처리 입문 NLP with TensorFlow - RNN부터 BERT까지
seq2seq를_이용한_NMT.ipynb 실습코드 에러 문의사항입니다.
실습 1 - TensorFlow와 Seq2Seq 모델을 이용해서 포르투칼어-영어 번역 수행해보기실습코드 내 GRU를 이용한 Encoder 부분에서 아래와 같이 error가 납니다.encoder = Encoder(vocab_inp_size, embedding_dim, units, BATCH_SIZE) # 샘플 입력 sample_hidden = encoder.initialize_hidden_state() sample_output, sample_hidden = encoder(example_input_batch, sample_hidden) print ('Encoder output shape: (batch size, sequence length, units) {}'.format(sample_output.shape)) print ('Encoder Hidden state shape: (batch size, units) {}'.format(sample_hidden.shape)) --------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-71-879487bff06b> in <cell line: 5>() 3 # 샘플 입력 4 sample_hidden = encoder.initialize_hidden_state() ----> 5 sample_output, sample_hidden = encoder(example_input_batch, sample_hidden) 6 print ('Encoder output shape: (batch size, sequence length, units) {}'.format(sample_output.shape)) 7 print ('Encoder Hidden state shape: (batch size, units) {}'.format(sample_hidden.shape)) 1 frames <ipython-input-69-76383a24b17a> in call(self, x, hidden) 12 def call(self, x, hidden): 13 x = self.embedding(x) ---> 14 output, state = self.gru(x, initial_state = hidden) 15 return output, state 16 ValueError: Exception encountered when calling Encoder.call(). too many values to unpack (expected 2) Arguments received by Encoder.call(): • x=tf.Tensor(shape=(64, 16), dtype=int32) • hidden=tf.Tensor(shape=(64, 1024), dtype=float32)self.gru(x, initia_state=hidden)부분에서 출력 결과가 두 개가 아닌 65개가 출력되어서 output, state 두 개로 할당하면 안되는 것 같습니다!
-
미해결TensorFlow Object Detection API 가이드 Part1 - 코드 10줄 수정으로 물체검출하기
버전 오류 23.05파일 포함.
2023 05 버전 해도 오류 납니다. 그리고 4강을 먼저 공부하고 싶어서 해봤는데 버전 오류 나느거 같은데 새로운 버전으로 수정된 강의가 필요합니다----------------------------------import matplotlib import matplotlib.pyplot as plt import io import scipy.misc import numpy as np from six import BytesIO from PIL import Image, ImageDraw, ImageFont import tensorflow as tf from object_detection.utils import label_map_util from object_detection.utils import config_util from object_detection.utils import visualization_utils as viz_utils from object_detection.builders import model_builder %matplotlib inline-------------------------------/usr/local/lib/python3.10/dist-packages/numpy/_core/_dtype.py:106: FutureWarning: In the future np.bool will be defined as the corresponding NumPy scalar. if dtype.type == np.bool: /usr/local/lib/python3.10/dist-packages/numpy/_core/_dtype.py:106: FutureWarning: In the future np.bool will be defined as the corresponding NumPy scalar. if dtype.type == np.bool: --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-6-49156a41fe80> in <cell line: 15>() 13 from object_detection.utils import config_util 14 from object_detection.utils import visualization_utils as viz_utils ---> 15 from object_detection.builders import model_builder 16 17 get_ipython().run_line_magic('matplotlib', 'inline') 23 frames/usr/local/lib/python3.10/dist-packages/scipy/interpolate/_fitpack_impl.py in <module> 101 102 _parcur_cache = {'t': array([], float), 'wrk': array([], float), --> 103 'iwrk': array([], dfitpack_int), 'u': array([], float), 104 'ub': 0, 'ue': 1} 105 TypeError:
-
미해결파이썬을 활용한 머신러닝 딥러닝 입문
섹션7 텐서플로 허브 Trained_MobileNet 모델 생성 오류 해결 방법
"Only instances of keras.Layer can be " 97 f"added to a Sequential model. Received: {layer} " ValueError: Only instances of keras.Layer can be added to a Sequential model. Received: <tensorflow_hub.keras_layer.KerasLayer object at 0x791605217610> (of type <class 'tensorflow_hub.keras_layer.KerasLayer'>)위와 같은 오류가 나서 한참 찾았는데요. 원인은 tensorflow_hub와 tensorflow 간의 keras 필요 버전 차이에 있다고 합니다. 아래와 같이 keras를 별도 설치하여 임포트하여 사용하시면 정상 작동됩니다. 같은 에러로 고민이신 분에게 도움이 됐으면 좋겠네요. 수정 소스 코드!pip install tf_kerasimport tf_keras as tfk Trained_MobileNet_url = "https://tfhub.dev/google/tf2-preview/mobilenet_v2/classification/2" Trained_MobileNet = tfk.Sequential([ hub.KerasLayer(Trained_MobileNet_url, input_shape=(224, 224, 3)) ]) Trained_MobileNet.input, Trained_MobileNet.output
-
미해결차량 번호판 인식 프로젝트와 TensorFlow로 배우는 딥러닝 영상인식 올인원
Custom Dataset 실전 프로젝트 실습 1 - CRNN를 이용한 License Plate OCR 모델(Custom Dataset) 학습
결과 30만 나오는 현상 무엇이 잘못되었을까요?데이터 전부 30만 나옵니다
-
미해결차량 번호판 인식 프로젝트와 TensorFlow로 배우는 딥러닝 영상인식 올인원
Custom Dataset 실전 프로젝트 실습 1 - CRNN를 이용한 License Plate OCR 모델(Custom Dataset) 학습
recognizer = keras_ocr.recognition.Recognizer()여기서 인식할 수 없는 키워드가 Dense에 전달되었다고 하면서 진행이 되질 않습니다.
-
미해결차량 번호판 인식 프로젝트와 TensorFlow로 배우는 딥러닝 영상인식 올인원
Custom Dataset 실전 프로젝트 실습 1 - CenterNet을 이용한 License Plate Detection 모델(Custom Dataset) 학습 실습 Solution
- CenterNet을 이용한 License Plate Detection 모델(Custom Dataset) 학습 실습 Solution 실습해보는데 계속 버젼이 달라서 그런지 실행이 안되네요
-
미해결예제로 배우는 딥러닝 자연어 처리 입문 NLP with TensorFlow - RNN부터 BERT까지
실습 2 - Char-RNN 코드 학습 부분에서 오류가 발생합니다.
안녕하세요.실습 2 - Char-RNN 코드 학습 부분에서 ValueError: Unrecognized keyword arguments passed to Embedding: {'batch_input_shape': [64, None]} 오류가 발생합니다.
-
해결됨딥러닝 CNN 완벽 가이드 - TFKeras 버전
albumentations ShiftScaleRotate
ShiftScaleRotate에서 Only Scale 변환 후 원본 이미지와 사이즈가 같은 이유가 무엇인지 궁금합니다.ShiftScaleRotate 내부에서 원본 크기로 resize해주는 것인지 내부에서 Super Resolution을 적용해주는 것인지 궁금합니다. 화질이 손상되지 않은거 같아서 여쭈어봅니다.
-
미해결예제로 배우는 딥러닝 자연어 처리 입문 NLP with TensorFlow - RNN부터 BERT까지
pad_both_ends 사용할 때 n은 왜 사용하나요?
제목 그대로 pad_both_ends 사용할 때 n은 왜 사용하나요?그냥 앞뒤로 붙여주면 될 것 같은데, 3을 넣으니 두개씩 붙던데 n값을 설정하는 이유가 있나요?ngram의 n과 관련이 있나요?
-
미해결딥러닝 CNN 완벽 가이드 - TFKeras 버전
Model Input Size 관련
먼저, 비전공자도 이해할 수 있도록 섬세하게 강의해주셔서 감사합니다.강의에서 efficientnet, xception 등 좋은 딥러닝 모델들을 소개해주셨는데요 실제 어떤 모델이 좋을지 테스트하다 보니 Input size 관련해서 아래와 같은 궁금증이 생깁니다.모델마다 권장 사이즈가 다 다르던데 여러 모델을 테스트 할 때 모델별 권장 Input size로 resize 하는게 좋을까요? 아니면 특정 사이즈로 고정해서 테스트 하는 것이 좋을까요? 이미지를 축소하는 경우보다 확대해서 모델에 넣는 경우 성능이 더 안 좋을까요?
-
미해결[개정판] 딥러닝 컴퓨터 비전 완벽 가이드
Feature 표현에 대한 질문입니다.
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 강의 내용을 질문할 경우 몇분 몇초의 내용에 대한 것인지 반드시 기재 부탁드립니다. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.안녕하세요 교수님. 강의 잘 듣고있습니다.SPPNet의 이해 02 2:30 경에서 SPM으로 균일한 크기의 vector를 표현한다고 했는데 여기서 feature 표현이 3개가 있을 경우 ... 하는게 어떤 말인지 이해가 안 갑니다.예를들어 Max Pooling을 진행한다고 하면 사분면이 나뉘어지지 않았을 때는 1개를 뽑고 4개로 나누어지면 4개, 16개면 16개를 뽑을텐데 여기서 3을 곱하는게 어떨때 곱하는지 이해가 잘 안갑니다. 감사합니다.
-
해결됨TensorFlow 2.0으로 배우는 딥러닝 입문
선형 회귀 모델에 대해서 질문 있습니다
강좌 TensorFlow 2.0을 이용한 선형 회귀 알고리즘 구현 편에서 나오는 선형 회귀 모델을 실행하였을 때 결과값이 계속하여 미세하게 변화하는 이유가 궁금해서 질문합니다. 수학적 계산식을 항상 동일하니 계산값 역시 항상 동일해야 하는 것 아닌가요?
-
미해결파이썬을 활용한 머신러닝 딥러닝 입문
Crash 파일 위치
쥬피터 노트북에서 crash 강의를 수강하려는데 다운 받은 파일집에는 영상과 다른 00.Table of contaent파일로 존재하는데 어떻게 수강해야하나요?
-
해결됨[개정판] 딥러닝 컴퓨터 비전 완벽 가이드
mm_faster_rcnn_train_coco_bccd 학습시 수행이 안됩니다
--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[20], line 4 2 mmcv.mkdir_or_exist(osp.abspath(cfg.work_dir)) 3 # epochs는 config의 runner 파라미터로 지정됨. 기본 12회 ----> 4 train_detector(model, datasets, cfg, distributed=False, validate=True) File /opt/conda/lib/python3.10/site-packages/mmdet-2.28.2-py3.10.egg/mmdet/apis/train.py:163, in train_detector(model, dataset, cfg, distributed, validate, timestamp, meta) 156 model = build_ddp( 157 model, 158 cfg.device, 159 device_ids=[int(os.environ['LOCAL_RANK'])], 160 broadcast_buffers=False, 161 find_unused_parameters=find_unused_parameters) 162 else: --> 163 model = build_dp(model, cfg.device, device_ids=cfg.gpu_ids) 165 # build optimizer 166 auto_scale_lr(cfg, distributed, logger) File /opt/conda/lib/python3.10/site-packages/mmcv/utils/config.py:524, in Config.__getattr__(self, name) 523 def __getattr__(self, name): --> 524 return getattr(self._cfg_dict, name) File /opt/conda/lib/python3.10/site-packages/mmcv/utils/config.py:52, in ConfigDict.__getattr__(self, name) 50 else: 51 return value ---> 52 raise ex AttributeError: 'ConfigDict' object has no attribute 'device'^캐글--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-25-adb1a52111f0> in <cell line: 4>() 2 mmcv.mkdir_or_exist(osp.abspath(cfg.work_dir)) 3 # epochs는 config의 runner 파라미터로 지정됨. 기본 12회 ----> 4 train_detector(model, datasets, cfg, distributed=False, validate=True) 2 frames /usr/local/lib/python3.10/dist-packages/mmcv/utils/config.py in __getattr__(self, name) 50 else: 51 return value ---> 52 raise ex 53 54 AttributeError: 'ConfigDict' object has no attribute 'device'^코랩 안녕하세요 좋은 강의 감사드립니다. import os.path as ospmmcv.mkdir_or_exist(osp.abspath(cfg.work_dir))# epochs는 config의 runner 파라미터로 지정됨. 기본 12회train_detector(model, datasets, cfg, distributed=False, validate=True) 이 셀이 실행시 이러한 오류가 뜨는데 이유를 모르겠습니다
-
미해결예제로 배우는 딥러닝 자연어 처리 입문 NLP with TensorFlow - RNN부터 BERT까지
트레이닝 에러 발생
for epoch in range(EPOCHS): start = time.time() train_loss.reset_states() train_accuracy.reset_states() # inp -> portuguese, tar -> english for (batch, (inp, tar)) in enumerate(train_batches): train_step(inp, tar) if batch % 50 == 0: print(f'Epoch {epoch + 1} Batch {batch} Loss {train_loss.result():.4f} Accuracy {train_accuracy.result():.4f}') if (epoch + 1) % 5 == 0: ckpt_save_path = ckpt_manager.save() print(f'Saving checkpoint for epoch {epoch+1} at {ckpt_save_path}') print(f'Epoch {epoch + 1} Loss {train_loss.result():.4f} Accuracy {train_accuracy.result():.4f}') print(f'Time taken for 1 epoch: {time.time() - start:.2f} secs\n')위 코드에서 에러 발생합니다. GPT 에도 물어보고 해도 답이 안나와서 조치 방법 질문드립니다.AttributeError Traceback (most recent call last) <ipython-input-109-d5f75ec190c4> in <cell line: 1>() 2 start = time.time() 3 ----> 4 train_loss.reset_states() 5 train_accuracy.reset_states() 6 AttributeError: 'Mean' object has no attribute 'reset_states'
-
미해결예제로 배우는 딥러닝 자연어 처리 입문 NLP with TensorFlow - RNN부터 BERT까지
트랜스포머 인코더 레이어 테스트 에러
sample_encoder_layer = EncoderLayer(512, 8, 2048) sample_encoder_layer_output = sample_encoder_layer(tf.random.uniform((64, 43, 512)), False, None) sample_encoder_layer_output.shape # (batch_size, input_seq_len, d_model)해당 코드에서 아래 에러가 떴어요. 어떻게 조치하면 될까요?Only input tensors may be passed as positional arguments. The following argument value should be passed as a keyword argument: False (of type <class 'bool'>)
-
미해결[개정판] 딥러닝 컴퓨터 비전 완벽 가이드
안녕하세요 라벨 관련 질문드려요
안녕하세요,제가 직접 가지고 있는 jpg 사진으로 labelme 5.21 버전으로 label하여 json 문서로 출력하려 fast-rcnn이나 mask-rcnn,yolo 으로 segmentation하려고 합니다. 혹시 수업 강의 자료로 할수있는지 궁금해서 질문올립니다~
-
미해결[개정판] 딥러닝 컴퓨터 비전 완벽 가이드
ROI Pooling 질문 드립니다.
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 강의 내용을 질문할 경우 몇분 몇초의 내용에 대한 것인지 반드시 기재 부탁드립니다. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.R-CNN에서는 기존의 이미지를 CNN모델에 넣기 위해서 변형을 하다보니깐(warp), 원본의 정보가 훼손될 수 있다고도 하셨는데,Fast R-CNN에서 Feature Map에서 SS를 매칭시킨 결과를 ROI Pooling에 넣기 위해서 변형하는 것은 F.M의 정보를 훼손 시키지 않는 건가요?아니면, 훼손되더라도 그 결과가 좋기 때문에 그냥 그렇게 ROI Pooling 사이즈에 일괄적으로 맞추는건가요?