코랩 프로 플러스를 사용하고 있는 수강생입니다. 먼저 cloudflare를 다운받습니다. 이후 !pip install colab-ssh --upgrade from colab_ssh import launch_ssh_cloudflared, init_git_cloudflared launch_ssh_cloudflared(password='임의로 설정') # password는 임의로 설정 이걸 코랩 노트북에 작성해놓습니다. 그리고 vscode에서 ssh.config에 다음 사항을 작성해놓습니다. Host *.trycloudflare.com HostName %h User root Port 22 ProxyCommand C:\Program Files (x86)\cloudflared\cloudflared.exe access ssh --hostname %h 그 이후에 ssh로 접속해서 vscode에서 구글 드라이브와 연동하여 사용하고 있습니다. 개인적으로 gpu 작업이 필요할 때 사용하는 방법이었는데, 일반적으로 많이 사용하는 방법인지 궁금합니다. gpu 자원을 갖고 있지 않아 코랩 프로 플러스를 구독하여 사용하고 있는데, 매번 작업할 때마다 환경을 조금씩 설정해줘야 하는 불편함이 있어서 코랩을 사용하려면 어쩔 수 없는 방법인지가 궁금합니다.
130_Transformer.ipynb를 수정없이 colab에서 모두 실행하였을 때, transformer.summary() 블럭에서 다음과 같은 에러가 나옵니다. 어떤 부분을 수정하면 좋을지 알 수 있을까요? --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-51-b0463e4f27a6> in <cell line: 1>() ----> 1 transformer.summary() 1 frames /usr/local/lib/python3.10/dist-packages/keras/src/utils/traceback_utils.py in error_handler(*args, **kwargs) 120 # To get the full stack trace, call: 121 # `keras.config.disable_traceback_filtering()` --> 122 raise e.with_traceback(filtered_tb) from None 123 finally: 124 del filtered_tb /usr/local/lib/python3.10/dist-packages/optree/ops.py in tree_map(func, tree, is_leaf, none_is_leaf, namespace, *rests) 745 leaves, treespec = _C.flatten(tree, is_leaf, none_is_leaf, namespace) 746 flat_args = [leaves] + [treespec.flatten_up_to(r) for r in rests] --> 747 return treespec.unflatten(map(func, *flat_args)) 748 749 TypeError: 'int' object is not iterable
강사님 seq2seq 모델의 경우 학습할 때와 추론할 때 서로 다른 모델을 정의하여 사용하였습니다. 하지만 트랜스포머는 그렇지 않고 추론할 때도 같은 모델을 사용하고 있습니다. 두 개의 모델 모두 교사강요학습을 사용하고 있고 인코더/디코더 구조를 가지고 있는데 왜 두개가 이렇게 차이가 있는 것인지요?
# 훈련 데이터셋에서 포르투갈어 및 영어 예제 출력 for pt_examples, en_examples in train_examples.batch(3).take(1): print('> 포르투갈어 예제:') for pt in pt_examples.numpy(): print(pt.decode('utf-8')) # 포르투갈어 문장 디코딩하여 출력 print() print('> 영어 예제:') for en in en_examples.numpy(): print(en.decode('utf-8')) # 영어 문장 디코딩하여 출력 =====> 위의 코드에 pt 와 en 이 어떻게 생성된 변수인지 잘 이해가 안 가서 여쭤봅니다.
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 강의 내용을 질문할 경우 몇분 몇초의 내용에 대한 것인지 반드시 기재 부탁드립니다. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 안녕하세요. 로드맵 따라가며 강의 정말 잘 듣고있습니다 ! 항상 친절한 답변도 감사드립니다. 다름이 아니라 Yolo 3를 구현하면서 궁금증이 생겼습니다. 1. output을 담당하는 layer가 3개이므로(13X13/26X26/52X52) 3개의 layer에서 forward를 이용하여 결과를 추출한다고 이해했는데 이게 맞나요? 3개에서 뽑은 output(confidence_threshold보다 큰) 을 종합한 후 NMS process를 거쳐서 최종적으로 조건에 맞는 index를 반환받아 그 index를 이용해 image에 구현한다고 이해했는데 이것도 맞을까요? 만약 위에서 제가 이해한게 어느정도 맞다면 마지막으로 드는 궁금증은 13X13, 26X26, 52X52에서 각 Grid Cell이 image의 object를 예측할텐데, 이는 비유하자면 Random Forest에서 각각 학습한 model이 다수결(?)로 infernece한다고 이해해도 될까요? 즉, 세개의 Multi Scale에서 학습한 각각의 gride cell의 anchor box들이 자신의 의견을 내놓아 그중 confidence, nms의 조건을 이용해 최종적으로 조건에 부합하는 몇 개의 bbox만 남는걸로 이해해도 되는지 여쭤보고 싶습니다..!
강의 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()
교사학습용 데이터와 target 데이터 모두 post 패딩을 하였는데 교사학습용 데이터는 <sos> 가 중요하고 target 데이터는 <eos> 가 중요하기 때문에 교사학습용은 post, target 데이터는 pre 를 해야 하는거 아닌지요? 만약 post 패딩을 하게 되면 길이가 초과하는 교사학습용 데이터는 <sos>가 잘려지지 않을까 생각합니다. 강사님 부탁드리겠습니다.
TensorFlow Object Detection API 가이드 Part1 - 코드 10줄 수정으로 물체검출하기
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:
"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_keras import 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
ShiftScaleRotate에서 Only Scale 변환 후 원본 이미지와 사이즈가 같은 이유가 무엇인지 궁금합니다. ShiftScaleRotate 내부에서 원본 크기로 resize해주는 것인지 내부에서 Super Resolution을 적용해주는 것인지 궁금합니다. 화질이 손상되지 않은거 같아서 여쭈어봅니다.