묻고 답해요
130만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
해결됨Google 공인! 텐서플로(TensorFlow) 개발자 자격증 취득
슬랙 초대 및 진행 방법 알려주시면 감사드립니다
hyunoo9495@gmail.com질문 및 실전 문제를 받고 싶어서 그런데 슬랙 초대 부탁 드립니다. 그리고 슬랙 초대 이후 진행방법이 어떻게 되는지도 안내 부탁 드립니다!
-
해결됨Google 공인! 텐서플로(TensorFlow) 개발자 자격증 취득
강의자료 찾기가 너무 힘들어요 메일로 부탁드립니다.
강의자료 찾기가 너무 힘들어요 메일로 부탁드립니다.회사 pc가 폐쇄망으로 구글 드라이브가 실행되지 않아 파일을 볼수가 없습니다. loveday3579@naver.com
-
해결됨비전공자를 위한 진짜 입문 올인원 개발 부트캠프
map foreach 매개변수 이름은 product, index아니여도 되네요
그냥 첫번째 매개변수가 대상이고 두번째 매개변수는 index취급하는건가요?
-
해결됨비전공자를 위한 진짜 입문 올인원 개발 부트캠프
postman으로 만든 주소는 만든사람 본인만 들어가지는건가요
다른 사람은 못보는걸까요
-
해결됨파이썬을 활용한 머신러닝 딥러닝 입문
categorical 변수의 수치화
강의 중에 성별의 경우 성별이라는 COLUMN에 여자는 0, 남자는 1 이런식으로 하면 안 되고 여자 칼럼/남자 칼럼을 나눠줘야 한다고 하셨는데 그 이유가 뭔지 질문 드립니다! 대소관계가 없도록 하는 거라고 하셨는데, 잘 이해가 되지 않아서요! 또 그럼 반대로 ordinal category의 경우 사이즈라는 칼럼을 만들어서 L은 3, m은 2, s는 1로 한 번에 넣어도 괜찮은 건가요? 늘 감사합니다, 강사님!
-
해결됨파이썬을 활용한 머신러닝 딥러닝 입문
Residual Error
앙상블의 boosting에 대해 듣던 중 질문이 있어 글을 남깁니다! residual error를 실제 값과 예측값의 차이라고 이해했는데, 검색해보니 단순 error와는 조금 다른 말이라는 이야기가 많아서요. 혹시 error와 residual error에 차이가 있나요?
-
해결됨TensorFlow 2.0으로 배우는 딥러닝 입문
Mnist 에 keras를 통해 softmax를 활용한 regerssion error 발생
안녕하세요. windows 환경에서 코드를 실행시키고 있는데 error가 발생해서 문의 드립니다. 코드는 제가 전혀 손대지 않아서 강사님이 공유해 주신 그대로의 코드 입니다. [mnist_classification_using_softmax_regression_v2_keras.py 코드]# -*- coding: utf-8 -*- import tensorflow as tf # MNIST 데이터를 다운로드 합니다. (x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data() # 이미지들을 float32 데이터 타입으로 변경합니다. x_train, x_test = x_train.astype('float32'), x_test.astype('float32') # 28*28 형태의 이미지를 784차원으로 flattening 합니다. x_train, x_test = x_train.reshape([-1, 784]), x_test.reshape([-1, 784]) # [0, 255] 사이의 값을 [0, 1]사이의 값으로 Normalize합니다. x_train, x_test = x_train / 255., x_test / 255. # 레이블 데이터에 one-hot encoding을 적용합니다. y_train, y_test = tf.one_hot(y_train, depth=10), tf.one_hot(y_test, depth=10) # tf.data API를 이용해서 데이터를 섞고 batch 형태로 가져옵니다. train_data = tf.data.Dataset.from_tensor_slices((x_train, y_train)) train_data = train_data.repeat().shuffle(60000).batch(100) train_data_iter = iter(train_data) # tf.keras.Model을 이용해서 Softmax Regression 모델을 정의합니다. class SoftmaxRegression(tf.keras.Model): def __init__(self): super(SoftmaxRegression, self).__init__() self.softmax_layer = tf.keras.layers.Dense(10, activation=None, kernel_initializer='zeros', bias_initializer='zeros') def call(self, x): logits = self.softmax_layer(x) return tf.nn.softmax(logits) # cross-entropy 손실 함수를 정의합니다. @tf.function def cross_entropy_loss(y_pred, y): return tf.reduce_mean(-tf.reduce_sum(y * tf.math.log(y_pred), axis=[1])) #return tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(logits=logtis, labels=y)) # tf.nn.softmax_cross_entropy_with_logits API를 이용한 구현 # 최적화를 위한 그라디언트 디센트 옵티마이저를 정의합니다. optimizer = tf.optimizers.SGD(0.5) # 최적화를 위한 function을 정의합니다. @tf.function def train_step(model, x, y): with tf.GradientTape() as tape: y_pred = model(x) loss = cross_entropy_loss(y_pred, y) gradients = tape.gradient(loss, model.trainable_variables) optimizer.apply_gradients(zip(gradients, model.trainable_variables)) # 모델의 정확도를 출력하는 함수를 정의합니다. @tf.function def compute_accuracy(y_pred, y): correct_prediction = tf.equal(tf.argmax(y_pred,1), tf.argmax(y,1)) accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32)) return accuracy # SoftmaxRegression 모델을 선언합니다. SoftmaxRegression_model = SoftmaxRegression() # 1000번 반복을 수행하면서 최적화를 수행합니다. for i in range(1000): batch_xs, batch_ys = next(train_data_iter) train_step(SoftmaxRegression_model, batch_xs, batch_ys) # 학습이 끝나면 학습된 모델의 정확도를 출력합니다. print("정확도(Accuracy): %f" % compute_accuracy(SoftmaxRegression_model(x_test), y_test)) # 정확도 : 약 91% 그리고 해당 코드가 있는 곳에 python으로 실행을 시키면 아래와 같은 결과가 나옵니다....(중략)...--> TypeError: unhashable type: 'list' 라는 에러가 발생하고 있습니다.--> 여러 사이트 검색과 코드 변경으로 문제 해결을 시도 하였으나 해결이 되지 않아서 어떻게 해결해야 하는지 가르쳐 주시면 감사하겠습니다. [에러 화면 전체 이미지]
-
미해결비전공자를 위한 진짜 입문 올인원 개발 부트캠프
display flex 및 link가 제대로 작동 안합니다...ㅠ
안녕하세요! 두 가지 질문이 있어서 글 남깁니다. display flex가 특정 id에 적용이 안됩니다 ㅠㅠapp.js에서 id=header인 부분에 css를 적용시켰는데 딱 header 부분만 적용이 안됩니다. 코드는 아래와 같습니다. app.js 코드import logo from './logo.svg'; import './App.css'; import MainPageComponent from "./main/index.js" import React, { Component } from 'react'; import {Link, Switch, Route, useHistory} from 'react-router-dom' import UploadPage from './upload/index.js'; import ProductPage from './product/index.js'; import { Button } from 'antd'; import {DownloadOutlined} from '@ant-design/icons' function App() { const history = useHistory(); return ( <div> <div id="header"> <div id="header-area"> <Link to="/"> <img src="/images/icons/logo.png" /> </Link> <Button size="large" onClick={function(){ history.push('/upload'); }} icon={<DownloadOutlined />} > 상품 업로드 </Button> </div> </div> <div id="body"> <Switch> <Route exact={true} path="/"> <MainPageComponent /> </Route> <Route exact={true} path="/products/:id"> <ProductPage /> </Route> <Route exact={true} path="/upload"> <UploadPage /> </Route> </Switch> </div> <div id="footer"></div> </div> ); } export default App; app.css* { margin: 0; padding: 0; line-height: normal; } html, body, #root, #root > div { height: 100%; }; #header { height: 64px; /*가운데 정렬하는 방법*/ display: flex; justify-content: center; border-bottom: 1px solid gray; } #header-area { width: 1024px; height: 100%; display: flex; align-items: center; justify-content: space-between; } #header-area img { width: 128px; height: 36px; } #body { height: 100vh; width: 1024px; margin: 0 auto; /*가운데 정렬하는 방법 중 하나*/ padding: 24px; } #footer { height: 200px; background-color: rgb(230,230,230); }이렇게 했을 때 아래와 같이 header만 적용이 안됩니다...(header-area는 css가 잘 적용이 되네요) Link 제대로 작동 안됨Link 태그를 통해 상품 상세페이지로 넘어가는 코드를 구현했는데 잘 안되는 부분이 있습니다 ㅠㅠ 원래라면 상품 카드를 눌렀을 때 자동으로 상품 상세페이지로 넘어가면서 해당 페이지 내용이 나타나야하는데 저는 카드를 누르면 url 주소만 바뀌고 제가 수동으로 새로고침을 해야 해당 페이지로 넘어갑니다...(그랩마켓 로고를 눌렀을 때 메인페이지로 돌아가는 것도 마찬가지입니다) 위 코드에서 잘못된 부분이 어떤거길래 이렇게 되는걸까요...? 감사합니다!
-
해결됨[개정판] 딥러닝 컴퓨터 비전 완벽 가이드
YOLOv3 loss 계산 질문
안녕하세요. YOLOv3 논문을 읽고 정리하다가 궁금한 점이 생겨서 질문 드립니다. 해당 논문에 다음과 같은 문단이 나오는데요."YOLOv3 predicts an objectness score for each bounding box using logistic regression. This should be 1 if the bounding box prior overlaps a ground truth object by more than any other bounding box prior. If the bounding box prior is not the best but does overlap a ground truth object by more than some threshold we ignore the prediction, following [17]. We use the threshold of .5. Unlike [17] our system only assigns one bounding box prior for each ground truth object. If a bounding box prior is not assigned to a ground truth object it incurs no loss for coordinate or class predictions, only objectness." [17]은 Faster R-CNN에 해당합니다. YOLOv3의 경우 logistic regression을 이용하여 anchor box의 objectness를 예측하는데 ground truth와의 IoU가 최고인 anchor box의 경우에만 1을 할당하고 나머지 anchor box의 objectness score는 무시한다고 이해했습니다. 그러면 이미지에 객체가 하나가 있을 경우, 생성된 전체 anchor box 중에 객체의 ground truth와 IoU가 가장 높은 하나의 objectness score만 1이고 나머지 anchor box의 objectness score는 모두 0이 되는 건가요? 그리고 이 값을 이용해서 Object Confidence Loss가 계산되는건가요? YOLOv1의 경우 나눠진 각 grid cell의 책임 BBox의 (Object일 확률 x ground truth와의 IoU값)으로 Object Confidence Loss가 계산된 걸로 아는데 너무 헷갈리네요 ㅜㅜ
-
해결됨딥러닝을 활용한 자연어 처리 (NLP) 과정 (기초부터 ChatGPT/생성 모델까지)
320_Custom_Sentiment_Analysis_navermovie.ipynb 실행 시 오류 납니다.
안녕하세요,아래 예제도 오류가 납니다.320_Custom_Sentiment_Analysis_navermovie.ipynb수정 방법을 알고 싶습니다.pip install transformers[torch]` or pip install accelerate -U 이 부분은 수행했는데도 발생합니다.확인 부탁 드립니다. ImportError Traceback (most recent call last) <ipython-input-50-ed29579c1c8b> in <cell line: 1>() ----> 1 training_args = TrainingArguments( 2 output_dir='./results', # output 저장 directory 3 num_train_epochs=2, # total number of training epochs 4 per_device_train_batch_size=8, # batch size per device during training 5 per_device_eval_batch_size=16, # batch size per device during evaluation 4 frames/usr/local/lib/python3.10/dist-packages/transformers/training_args.py in _setup_devices(self) 1903 if not is_sagemaker_mp_enabled(): 1904 if not is_accelerate_available(): -> 1905 raise ImportError( 1906 f"Using the `Trainer` with `PyTorch` requires `accelerate>={ACCELERATE_MIN_VERSION}`: " 1907 "Please run `pip install transformers[torch]` or `pip install accelerate -U`" ImportError: Using the `Trainer` with `PyTorch` requires `accelerate>=0.21.0`: Please run `pip install transformers[torch]` or `pip install accelerate -U`
-
해결됨딥러닝을 활용한 자연어 처리 (NLP) 과정 (기초부터 ChatGPT/생성 모델까지)
201_classify_text_with_bert_tfhub_Kor.ipynb 오류
안녕하세요?201_classify_text_with_bert_tfhub_Kor.ipynb 소스 수행 시 아래와 같은 오류가 납니다.구글 colab gpu에서 돌리고 있습니다. (오류 이미지도 같이 첨부합니다.)왜 오류가 나는지 답변 부탁 드립니다. ValueError Traceback (most recent call last) <ipython-input-17-3b4b1d94b15e> in <cell line: 1>() ----> 1 classifier_model = build_classifier_model() 2 bert_raw_result = classifier_model(tf.constant(text_test)) 3 4 print(bert_raw_result) 5 print(tf.sigmoid(bert_raw_result)) 7 frames/usr/local/lib/python3.10/dist-packages/keras/src/backend/common/keras_tensor.py in __array__(self) 59 60 def __array__(self): ---> 61 raise ValueError( 62 "A KerasTensor is symbolic: it's a placeholder for a shape " 63 "an a dtype. It doesn't have any actual numerical value. " ValueError: Exception encountered when calling layer 'preprocessing' (type KerasLayer). A KerasTensor is symbolic: it's a placeholder for a shape an a dtype. It doesn't have any actual numerical value. You cannot convert it to a NumPy array. Call arguments received by layer 'preprocessing' (type KerasLayer): • inputs=<KerasTensor shape=(None,), dtype=string, sparse=None, name=text> • training=None
-
해결됨[개정판] 딥러닝 컴퓨터 비전 완벽 가이드
코랩 세션 다운
안녕하세요. 학습에 관련하여 질문이 있어 남깁니다. 현재 코랩에서 이미지 데이터에 대한 학습을 진행 중에 있습니다. import os.path as osp mmcv.mkdir_or_exist(osp.abspath(cfg.work_dir)) train_detector(model, datasets, cfg, distributed=False, validate=True)위와 같은 코드를 진행하였을 때, epoch 1번 수행 후 세션이 종료 됩니다. 위와 같은 문제로 validate=false로 진행 할 경우, 학습은 잘 작동하지만 validation에 대한 loss값만 표시되고 AP 값은 나오지 않아 학습된 모델의 평가를 어떻게 진행해야 할지 의문입니다.
-
미해결딥러닝 CNN 완벽 가이드 - Fundamental 편
안녕하세요 교수님
'Dense Layer로 Fashion MNIST 예측 모델 구현하기 - 이미지 데이터 확인 및 사전 데이터 처리' 강의코드중 궁금한 내용이 있어 질문드립니다.train_images[0, :, :] 코드를 사용하셨는데 train_images[0]이 아닌 이미지 인덱스에 전체 행과 열을 불러오는 부분을 추가하신 특별한 이유가 있을까요?
-
해결됨파이썬을 활용한 머신러닝 딥러닝 입문
매트릭스로 만들어주는 것
part1의 실습 - 선형회귀모델 - 당뇨병진행률 예측에서 질문 있습니다! diabetes_X를 정의할 때 reshape해주는 게 매트릭스를 만들기 위해서라고 해주셨는데요!혹시 그럼 Test 셋을 정의할 때에는 그럴 필요가 없는 건가요?(??,)인 걸 (??,1)로 만들어주는 RESHAPE를 diabetes_X할 때는 했는데, diabetes.target은 그냥 (??,) 형태인데도 따로 그 과정을 안 거치는 지 궁금합니다!
-
미해결[개정판] 딥러닝 컴퓨터 비전 완벽 가이드
안녕하십니까! 질문이 있습니다.
32 32 에서는 보다 작은 이미지들이 검출되고4 * 4에는 보다 큰 이미지들이 검출된다고 말씀하셨는데. FC layer은 사이즈 마다 실행되는건가요?예를들어 32 32에서는 사람이 검색되고 4 4에서는 자동차가 검출되었다고 했을 때 32 32에서도 FClayer가 수행이되고 4 4에서도 FClayer가 수행되서 결과로는 자동차 & 사람 모두가 검출되는 원리 인건가요?
-
해결됨딥러닝 CNN 완벽 가이드 - Fundamental 편
가중치 초기화(Weight Initialization) 질문입니다.
안녕하세요 교수님, CNN 강의와 같은 좋은 수업 감사드립니다.다름이 아니라 가중치 초기화를 공부하다가 생긴 궁금증에 질문 글을 달아봅니다.교수님께서 강의 하실 때 평균이 0, 표준 편차 1인 표준 정규 분포에서 Weight 초기화시 sigmoid 출력이 대부분 0과 1로 수렴하신다고 하셨는데이렇게 되는 이유가 평균이 0, 표준 편차가 1인 표준 정규 분포에서 Weight를 초기화하면 처음에 Weight값이 너무 작거나 혹은 너무 큰 값들로 배정되기 때문에 저렇게 되는 걸까요?즉, Weight값이 -1 ~ 1까지의 값들 중 임의로 배정되기 때문에 그런건가요?반대로 Sigmoid 출력이 대부분 0.5로 수렴하는 경우에는 -0.01 ~ 0.01중 Weight 값이 결정되기 때문에 그런걸까요?
-
미해결딥러닝을 활용한 자연어 처리 (NLP) 과정 (기초부터 ChatGPT/생성 모델까지)
트랜스포머 실습 파일 실행 시 에러가 발생합니다.
130_Transformer.ipynb를 코랩 환경에서 실행하는데 25번째 코드 셸을 실행하면 에러가 발생합니다.위의 모든 코드 셸을 실행한 뒤에 다음 코드를 실행하면 ValueError: Exception encountered when calling PositionalEmbedding.call().Invalid dtype: <property object at 0x7d6f6aff73d0> Arguments received by PositionalEmbedding.call(): • x=tf.Tensor(shape=(64, 110), dtype=int64) 이런 에러가 발생합니다. 어디가 문제이며 어떻게 해결을 해야 할까요? # 포르투갈어와 영어를 위한 위치 인코딩 임베딩 레이어 생성 embed_pt = PositionalEmbedding(vocab_size=tokenizers.pt.get_vocab_size(), d_model=512) embed_en = PositionalEmbedding(vocab_size=tokenizers.en.get_vocab_size(), d_model=512) # 포르투갈어 입력에 대한 임베딩 적용 pt_emb = embed_pt(pt) # 영어 입력에 대한 임베딩 적용 en_emb = embed_en(en)
-
해결됨딥러닝 CNN 완벽 가이드 - Fundamental 편
테스트 데이터셋 predict의 'NoneType' object has no attribute 'shape' 오류
안녕하세요.테스트 데이터셋을 predict하는 부분에서 오류가 나서 질문드립니다. test_path = test_df['path'].values test_ds = Plant_Dataset(image_filenames=test_path, labels=None, image_size=IMAGE_SIZE, batch_size=BATCH_SIZE, augmentor=None, shuffle=False, pre_func=xcp_preprocess_input) preds = xcp_model_01.predict(test_ds) --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[40], line 7 3 test_path = test_df['path'].values 4 test_ds = Plant_Dataset(image_filenames=test_path, labels=None, image_size=IMAGE_SIZE, batch_size=BATCH_SIZE, 5 augmentor=None, shuffle=False, pre_func=xcp_preprocess_input) ----> 7 preds = xcp_model_01.predict(test_ds) File /opt/conda/lib/python3.10/site-packages/keras/src/utils/traceback_utils.py:123, in filter_traceback.<locals>.error_handler(*args, **kwargs) 120 filtered_tb = _process_traceback_frames(e.__traceback__) 121 # To get the full stack trace, call: 122 # `keras.config.disable_traceback_filtering()` --> 123 raise e.with_traceback(filtered_tb) from None 124 finally: 125 del filtered_tb File /opt/conda/lib/python3.10/site-packages/tree/__init__.py:435, in map_structure(func, *structures, **kwargs) 432 for other in structures[1:]: 433 assert_same_structure(structures[0], other, check_types=check_types) 434 return unflatten_as(structures[0], --> 435 [func(*args) for args in zip(*map(flatten, structures))]) File /opt/conda/lib/python3.10/site-packages/tree/__init__.py:435, in <listcomp>(.0) 432 for other in structures[1:]: 433 assert_same_structure(structures[0], other, check_types=check_types) 434 return unflatten_as(structures[0], --> 435 [func(*args) for args in zip(*map(flatten, structures))]) AttributeError: 'NoneType' object has no attribute 'shape' test_image_batch, test_label_batch = next(iter(test_ds))print(test_image_batch.shape, test_label_batch)의 출력이 (32, 224, 224, 3) Nonehistory.history['val_auc']의 출력이 [0.9417113065719604, 0.9647012948989868, 0.9738287925720215, 0.9816075563430786, 0.9799161553382874, 0.9804703593254089, 0.9877450466156006, 0.9854006767272949, 0.9803326725959778, 0.9843235611915588]학습도 완료됐고 Plant_Dataset도 제대로 작동하고 있습니다.AttributeError:'NoneType' object has no attribute 'shape'으로 어느 부분이 문제가 되는지 질문드립니다.
-
미해결비전공자를 위한 진짜 입문 올인원 개발 부트캠프
Link 적용하기 관련 문의드립니다.
Link 수업 듣는 중에 아래 질문과 같이 동일한 문제가 발생했는데요(상품 클릭 시, 링크 변경은 되는데 페이지 이동이 안되는 현상)https://www.inflearn.com/questions/645148/link-%EC%A0%81%EC%9A%A9%ED%95%98%EA%B8%B0-%EA%B4%80%EB%A0%A8%EC%A7%88%EB%AC%B8 질문 확인하고<React.StrictMode> 을 제거하기 전에는 상품카드를 클릭했을때 url만 변경되고 페이지가 새로고침되지 않았습니다.<React.StrictMode> 제거해야지만 클릭시 url변경 + 페이지 새로고침까지 되었습니다강의와 동일하게 작성하였는데 왜 <React.StrictMode> 제거 후 문제가 해결된걸까요?
-
미해결파이썬을 활용한 머신러닝 딥러닝 입문
tf.data 를 이용한 shuffling and batch 구성 관련 문의
좋은강의 감사합니다.tf.data 를 이용한 shuffling and batch 구성 관련 문의 드립니다.tf.data 를 이용한 shuffling and batch 구성하는 경우의 코드(아래코드)를tf.data 를 이용한 shuffling and batch 구성하지 않는 경우로 변경하는 경우 아래코드를 어떻게 변경해야하나요?-아래-train_ds = tf.data.Dataset.from_tensor_slices((X_train_scaled, y_train_onehot))\.shuffle(10000).batch(128)test_ds = tf.data.Dataset.from_tensor_slices((X_test_scaled, y_test_onehot)).batch(128)..history = model.fit(train_ds, epochs=5, validation_data=test_ds)답변부탁드립니다.2024.3.9