묻고 답해요
161만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
해결됨U-Net 구현으로 배우는 딥러닝 논문 구현 with TensorFlow 2.0 - 딥러닝 의료영상 분석
evaluate isbi 2012.py 실행관련 문의드립니다.
안녕하세요. evaluate 중 문제가 발생해서 문의를 드립니다. train과 evaluate py의 경로 부분은 아래와 같이 수정을 하였습니다.flags.DEFINE_string('checkpoint_path', default='saved_model_isbi_2012/unet_model', help='path to a directory to save model checkpoints during training') 그 결과 생성된 파일은 다음과 같습니다. python evaluate_isbi_2012.py실행 결과 나타난 오류는 다음과 같습니다. Traceback (most recent call last):File "evaluate_isbi_2012.py", line 89, in <module>app.run(main)File "C:\Users\Song\anaconda3\envs\unet_test3\lib\site-packages\absl\app.py", line 308, in runrunmain(main, args)File "C:\Users\Song\anaconda3\envs\unet_test3\lib\site-packages\absl\app.py", line 254, in runmainsys.exit(main(argv))File "evaluate_isbi_2012.py", line 66, in mainunet_model.load_weight(FLAGS.checkpoint_path)AttributeError: 'UNET_ISBI_2012' object has no attribute 'load_weight' 해결방법 알려주시면 정말 감사하겠습니다.
-
미해결[개정판] 딥러닝 컴퓨터 비전 완벽 가이드
tensorboard error
안녕하세요 강사님,저는 보완 문제로 폐쇄 네트워크환경(소스내에서 downloac 차단)에서 object detection AutoML을 실행하고 있습니다. yolov3 소프 포팅후 자체 host pc에서 running이 되도록 해야 하는데 환경구축이 만만치 않네요.. 모든 datasets zip 파일들을 따로 다운 받아 집에서는 vs code나 jupyter notebook으로 작업하고 회사에서는 kubeflow notebook 환경에서 테스트 진행하고 있습니다.질문 1: coco val & coco test에서 --data coco.yaml 대신 --data coco128.yaml로 실행해도 되는 건지 알고 싶습니다.질문 2: train.py 전에 tensorboard launch 시 에러가 나옵니다. 해결 방법을 알려 주시면 감사 하겠습니다.질문 3: 질문2의 에러가 해결되어 train.py 실행 되는 건지, 그리고 coco test를 하지 않고 바로 train.py를 진행해도 되는건지 알고 싶습니다. 집에서 vs code나 jupyter notebook에서 train.py 실행을 하면 아래 같은 에러가 나옵니다.coco128.yaml 에서 download 차단 없이 진행하면 kernel 이 죽어 restarting 이 되고 진행이 안되네요..download 차단하면 맨 아래 캡쳐 화면 처럼 멈쳐 버리고 Dead kernel 이 되어 버립니다. 혹 질문 2의 tensorboard 에러와 관련이 있는 건지 알려 주시기 바랍니다.질문 4: 마지막 질문인데.. 이 질문은 강의 내용에서 벗어나는 질문 이지만 해결을 못하고 있어 조언을 듣고자 합니다. 로컬 호스트 환경에서 yolov5 train.py가 잘 돌고 있는 상황에서 docker 이미지 빌디시 Dockerfile의 베이스 이미지를 FROM nvcr.io/nvidia/pytorch:21.10-py3 로 하면 container 가 바로 죽고 실행이 안되며, FROM python:3.9로 하면 container가 running 되는데 train.py 가 실행되다 epochs를 하다 멈쳐 버립니다. 이 문제가 gpu 문제인건지 아님 단지 memory 부족 문제인지 잘 판단이 안되는데.. 소중한 의견 주시면 감사 하겠습니다.
-
미해결비전공자를 위한 진짜 입문 올인원 개발 부트캠프
postman에서 no environment
postman에서 우측 상단의 no environment를 클릭해도다른 항목이 나오지 않습니다.
-
미해결[개정판] 딥러닝 컴퓨터 비전 완벽 가이드
RCNN에서 손실함수 구하기
안녕하세요?RCNN의 경우 classification에 대한 loss는 구할 수 없고 다만 bounding box regression은 구할 수 있는지 이유가 궁금합니다.RCNN의 경우는 최종 값을 판별하는 분류기가 CNN과 분리되어 있어서 역전파를 할 수 없어 classification의 경우는 오차 함수를 구할 수 가 없다고 이해했습니다. 그런데 어떻게 bounding box regression은 Loss 값을 구할 수 있는지 궁금합니다. 구한 Loss 값으로 CNN이 업데이트가 가능한지요?바쁘신 와중에 답변 주셔서 감사합니다^__________^
-
미해결[개정판] 딥러닝 컴퓨터 비전 완벽 가이드
Training dataset 관련
안녕하세요 강사님, 항상 좋은 수업 잘 듣고있습니다. mmdetection으로 Mask-RCNN + Resnet-101 model Training중 Training Dataset 구성 관련하여 질문있습니다. 제가 기존 model을 학습시키는데 사용된 모든 이미지 데이터는 1280x720 해상도였습니다.그러나 이번에 수집한 데이터는 2208x1242 해상도입니다. Q1. 각기 다른 해상도로 촬영된 이미지들을 하나의 데이터셋으로 만들고, 네트워크에 학습시켜도 문제가 없을까요?당연히 COCO dataset이나 PASCAL dataset을 살펴봐도 다양한 해상도의 이미지를 annotation하여 구성하였기 때문에 문제될 건 없다고 생각하는데일반적으로, 1280x720 해상도 이미지를 추론하는 경우, 동일한 해상도의 데이터셋으로 학습된 모델이 성능이 더 우수한지 궁금해서요.ex) 1280x720 이미지 추론시, 1280x720 해상도만으로 이루어진 데이터셋으로 학습된 model 사용1920x1080 이미지 추론시, 1920x1080 해상도만으로 이루어진 데이터셋으로 학습된 model 사용 2208x1242 이미지 추론시, 2208x1242 해상도만으로 이루어진 데이터셋으로 학습된 model 사용만약 일반적으로 이렇게 한다면, 새로 획득한 데이터가 아닌 라벨링되지 않은 1280x720해상도 데이터들을 더 annotation 작업 진행하려 합니다.
-
미해결[개정판] 딥러닝 컴퓨터 비전 완벽 가이드
GPU, test dataset 질문
코드 실행 후 두가지 여쭤보고 싶은 것이 있어 질문 드려봅니다.1.먼저 train, validation 데이터셋으로 학습을 시켜보았습니다.혹시 test dataset은 train, validation 데이터 이외의 학습시키지 않은 데이터로 결과를 확인하면 되나요? test dataset는 말그대로 test의 의미를 가지는 데이터셋 일까요?(loss나 accuracy를 구해볼 수 있을까요?)2.현재 CPU는 Intel core i9, GPU는 RTX 2080 Ti를 사용중에 있고, 하나의 이미지에서 모델 검출속도가 약 0.08s 나오고 있습니다.Window에서 사용중에 있고,그래픽카드 4개를 사용하려고 했지만, 멀티 gpu를 사용하게 되면 sh 파일을 사용해야되는 것으로 알고있고,window에서 sh 파일이 실행되지 않는 것을 확인했습니다.0.05s 이하로 검출시간을 줄이는 것이 목적이고, 그래픽카드 성능을 보면 RTX 3090이 약 2배정도 뛰어난 성능을 나타낸다고 나와있는데 그래픽카드를 바꾸면 속도가 목표 속도까지 향상이 될까요?혹은 sh 파일을 window에서 실행시켜서 멀티 gpu를 사용할 수 있을까요?감사합니다.
-
미해결[개정판] 딥러닝 컴퓨터 비전 완벽 가이드
mask-rcnn-test dataset
안녕하세요. 강의 잘 수강하고 있습니다.현재 mask rcnn-ballon 데이터셋 학습을 진행중입니다.주석에서 train, val, test dataset 환경 파라미터가 있다고 나와있는데, train, validation 데이터 이외의 test 데이터셋은 어디에서 확인할 수 있는지 알 수 있을까요?감사합니다.
-
해결됨딥러닝 CNN 완벽 가이드 - TFKeras 버전
최근 등장한 CNN 아키텍처
강의 중에 나오는 최근 모델은 2017년 SENet 즈음이 마지막으로 나오는데구글링을 해봐도 SENet이 등장한 2017년이 최근 모델로 나오더라구요그나마 2019년 ResNeXt50 정도가 있는 거 같은데최근 3년 2020~2022년 사이에 개발된 CNN 모델이 있을까요?이러한 최신 CNN 경향은 어디서 확인하나요?
-
미해결딥러닝 CNN 완벽 가이드 - TFKeras 버전
클래스 질문
안녕하세요. 강사님. 제가 이번 실습을 기반으로 병해충 진단 모델을 구축중입니다. 이에 대해 질문사항이 있어 질문드립니다.efficientNet모델로 딥러닝 모델을 만들고 있습니다. 총 16개의 병해충에 걸린 식물을 구분하는 모델입니다. output layer에서 최종적으로 예측하고 나온 16개의 확률값중에 가장 큰 확률값의 index가 4라고 할때 이게 어떤 식물인지 어떻게 아는건가요?..
-
미해결[개정판] 딥러닝 컴퓨터 비전 완벽 가이드
YOLO v1 바운딩 박스 관련
안녕하세요!YOLO v1의 이해 - 01에서 바운딩 박스가 셀마다 2개식 생성이 되는데 이때 셀마다 갖는 바운딩 박스의 크기나 모양 등이 동일한 것인가요? 아니면 랜덤하게 생성이 되는것인가요?감사합니다~
-
해결됨[개정판] 딥러닝 컴퓨터 비전 완벽 가이드
데이터 전처리
데이터 전처리 시 왜 0~ 255 사이의 픽셀값을 0 ~ 1 사이 값으로 변환해주는 걸까요?자료의 범위가 맞춰져야 해서인 거 같은데 자세한 이유가 알고 싶습니다.
-
미해결비전공자를 위한 진짜 입문 올인원 개발 부트캠프
다른건 다되는데 typeerror 가 뜹니다..
1.<pre>TypeError: Cannot read properties of undefined (reading 'create')const express = require("express"); const cors = require("cors"); const { application } = require("express"); const app = express(); const port = 8080; const models = require("./models"); app.use(express.json()); app.use(cors()); app.get("/products", (req, res) => { const query = req.query; console.log("QUERY:", query); res.send({ products: [ { id: 1, name: "농구공", price: 100000, seller: "조던", imgUrl: "images/products/basketball1.jpeg", }, { id: 2, name: "축구공", price: 50000, seller: "메시", imgUrl: "images/products/soccerball1.jpg", }, { id: 3, name: "키보드", price: 10000, seller: "그랩", imgUrl: "images/products/keyboard1.jpg", }, ], }); }); app.post("/products", (req, res) => { const body = req.body; const { name, description, price, seller } = body; models.Product.create({ name, description, price, seller, }) .then((result) => { console.log("상품 생성 결과 : ", result); res.send({ result, }); }) .catch((error) => { console.error(error); res.send("상품 업로드에 문제가 생겼습니다."); }); }); app.get("/products/:id/events/:eventId", (req, res) => { const params = req.params; const { id } = params; res.send(); }); app.listen(port, () => { console.log("그랩의 쇼핑몰 서버가 돌아가고 있습니다."); models.sequelize .sync() .then(() => { console.log("DB 연결 성공"); }) .catch((err) => { console.error(err); console.log("DB 연결 에러 ㅠ "); process.exit(); }); }); 그 전까진 다 실행 잘되고 테이블도 잘 만들어졌는데 postman 에 send 를 누르면 이렇게 나옵니다body 안에는 잘 들어가는데 create 에서 문제가 생긴거 같습니다. ㅠㅠ
-
미해결[개정판] 딥러닝 컴퓨터 비전 완벽 가이드
mAP 0.5와 mAP 0.5-0.95의 차이
mAP의 측정 기준 중mAP0.5와 mAP 0.5-0.95는 무엇을 의미하나요?보니까 IoU를 0.5에서 0.95까지 0.05씩 올려가면서 측정한 평균 mAP라는데, 이것이 무엇을 의미하는 지 자세히 모르겠습니다
-
미해결[개정판] 딥러닝 컴퓨터 비전 완벽 가이드
faster-rcnn inference 오류
현황 : BCCD에서 사용하던 코드로 Inference를 하려 했는데다음과 같은 오류가 발생하고 있습니다바쁘시겠지만 문의드립니다◇ 문의사항: 해결방안이 있을까요?코드import torchfrom mmdet.apis import multi_gpu_test, single_gpu_testfrom mmcv.parallel import MMDataParallel, MMDistributedDataParallelmodel_ckpt = MMDataParallel(model_ckpt, device_ids=[0])outputs=single_gpu_test(model_ckpt, data_loader, True, "저장폴더", 0.5)--------------------------------------------------------------------------- AssertionError Traceback (most recent call last) Input In [6], in <cell line: 8>() 5 model_ckpt = MMDataParallel(model_ckpt, device_ids=[0]) 6 # single_gpu_test를 활용하므로 samples_per_gpu는 1이 되야함 ----> 8 outputs=single_gpu_test(model_ckpt, data_loader, True, "저장폴더", 0.5) File ~/.local/lib/python3.9/site-packages/mmdet/apis/test.py:38, in single_gpu_test(model, data_loader, show, out_dir, show_score_thr) 36 img_tensor = data['img'][0].data[0] 37 img_metas = data['img_metas'][0].data[0] ---> 38 imgs = tensor2imgs(img_tensor, **img_metas[0]['img_norm_cfg']) 39 assert len(imgs) == len(img_metas) 41 for i, (img, img_meta) in enumerate(zip(imgs, img_metas)): File ~/.local/lib/python3.9/site-packages/mmcv/image/misc.py:34, in tensor2imgs(tensor, mean, std, to_rgb) 32 if torch is None: 33 raise RuntimeError('pytorch is not installed') ---> 34 assert torch.is_tensor(tensor) and tensor.ndim == 4 35 channels = tensor.size(1) 36 assert channels in [1, 3] AssertionError: show_result_pypot 사용 시 오류가 발생하는데해결방안이 있을까요?코드from mmdet.apis import show_result_pyplotimport cv2#brg image 사용img = cv2.imread("sample 이미지 위치")model.cfg = cfgresult = inference_detector(model, img)show_result_pyplot(model, img, result, score_thr=0.3)결과/home/namu/.local/lib/python3.9/site-packages/mmdet/datasets/utils.py:66: UserWarning: "ImageToTensor" pipeline is replaced by "DefaultFormatBundle" for batch inference. It is recommended to manually replace it in the test data pipeline in your config file. warnings.warn(
-
미해결딥러닝 CNN 완벽 가이드 - TFKeras 버전
미니배치 관련 질문
안녕하세요 선생님! BGD도 1:507 까지 모든 데이터를 순회하고 mini BGD도 사이즈를 나눠서 하지만 모든 데이터로 업데이트를 한다고 생각하는데 , 둘의 차이점이 무엇인가요?
-
미해결딥러닝 CNN 완벽 가이드 - TFKeras 버전
1 x 1 convolution을 적용하면 왜 비선형성이 좋아지는지 궁금합니다.
선생님. 처음부터 쭉 듣다보니, 어느새 절반 이상을 듣게 되었습니다! 좋은 강의 감사드립니다. 1 x 1 convolution을 적용하면 왜 비선형성이 좋아지는지 궁금합니다. convolution은 시행할수록 비선형성이 항상 좋아지는것인가요??
-
미해결비전공자를 위한 진짜 입문 올인원 개발 부트캠프
안녕하세요! useParams에서 막혀서 질문 남깁니다 ㅠㅠ
우선 웹라이브러리 파트의 Link태그 적용 강의에서 후반부에 useParams 를 사용하게 되는데, 이부분부터 무언가 오류가 발생하네요.. 1. 메인화면 들어갔을때 오류화면 2. 상품클릭했을때 콘솔로그 상품을 클릭했을때 변경된 주소까지는잘 적용 되고, useParams 를 사용하기 전까지는 정상 작동 했는데, product 폴더의 index.js 에 useParams 만 넣으면 위처럼 오류가 발생합니다 이전에 소스에서는 문제가 안생겼군요 ㅠㅠ import { useParams } from "react-router-dom"; function ProductPage() { const { id } = useParams(); return <h1>상품 상세 페이지 {id} 상품</h1>; } export default ProductPage; 오타가 있나 싶어서 소스자료 복붙해도 마찮가지여서 문의로 남깁니다... react-router-dom 설치 할때 버전을 확인 못하고 그냥 설치했다가 나중에 확인해서 5.2 버전으로 다시 설치했는데, package.json 에는 5.2버전으로 정상적으로 보여지긴 하는데 오류내용이 버전이 충돌이 나서 그런건가 싶기도 하고.. 해결 방법이 있을까요? ㅠㅠ
-
미해결[개정판] 딥러닝 컴퓨터 비전 완벽 가이드
mmdetection mask-rcnn 추론결과 title 이름 변경 관련
안녕하세요 강사님 mmdetection 관련해서 이론적으로나 실무적으로나 항상 많은 도움 받고있습니다. 강의 내용을 바탕으로 mmdetection code를 작성하던 도중 질문사항이 생겨서요 ㅎㅎ mmdetection Mask R-CNN 모델을 이용하여 추론결과 아래 사진과 같이 mask, bbox 두가지가 나타나는데 bbox위에 나타나는 title(coin) 대신 변수를 표시하고 싶습니다. class name, confidence score 가 아닌 ID, pixel number를 표시하고 싶습니다. 제 코드는 다음과 같습니다. img_name = path_dir + '/' + file_list[i] img_arr= cv2.imread(img_name, cv2.IMREAD_COLOR) img_arr_rgb = cv2.cvtColor(img_arr, cv2.COLOR_BGR2RGB) # cv2.imshow('img',img) fig= plt.figure(figsize=(12, 12)) plt.imshow(img_arr_rgb) # inference_detector의 인자로 string(file경로), ndarray가 단일 또는 list형태로 입력 될 수 있음. results = inference_detector(model, img_arr) #추론결과 디렉토리에 저장 model.show_result(img_arr, results, score_thr=0.8, title= bbox_color=(0,0,255),thickness=0.5,font_size=7, out_file= f'{save_dir1}{file_list[i]}') 이 결과 추론되는 사진은 다음과 같습니다 아래는 mmdetection/mmdet/core/visualization/image.py에 있는 imshow_det_bboxes 함수입니다. 아래 함수가 시각화 해주는 함수여서 해당 함수를 수정하면 될 것 같은데 아무리 뜯어봐도 어디를 고쳐야할 지 도저히 감이 오질 않습니다 ...ㅠㅠ def imshow_det_bboxes(img, bboxes, labels, segms=None, class_names=None, score_thr=0, bbox_color='green', text_color='green', mask_color=None, thickness=2, font_size=13, win_name='', show=True, wait_time=0, out_file=None): """Draw bboxes and class labels (with scores) on an image. Args: img (str or ndarray): The image to be displayed. bboxes (ndarray): Bounding boxes (with scores), shaped (n, 4) or (n, 5). labels (ndarray): Labels of bboxes. segms (ndarray or None): Masks, shaped (n,h,w) or None class_names (list[str]): Names of each classes. score_thr (float): Minimum score of bboxes to be shown. Default: 0 bbox_color (str or tuple(int) or :obj:`Color`):Color of bbox lines. The tuple of color should be in BGR order. Default: 'green' text_color (str or tuple(int) or :obj:`Color`):Color of texts. The tuple of color should be in BGR order. Default: 'green' mask_color (str or tuple(int) or :obj:`Color`, optional): Color of masks. The tuple of color should be in BGR order. Default: None thickness (int): Thickness of lines. Default: 2 font_size (int): Font size of texts. Default: 13 show (bool): Whether to show the image. Default: True win_name (str): The window name. Default: '' wait_time (float): Value of waitKey param. Default: 0. out_file (str, optional): The filename to write the image. Default: None Returns: ndarray: The image with bboxes drawn on it. """ assert bboxes.ndim == 2, \ f' bboxes ndim should be 2, but its ndim is {bboxes.ndim}.' assert labels.ndim == 1, \ f' labels ndim should be 1, but its ndim is {labels.ndim}.' assert bboxes.shape[0] == labels.shape[0], \ 'bboxes.shape[0] and labels.shape[0] should have the same length.' assert bboxes.shape[1] == 4 or bboxes.shape[1] == 5, \ f' bboxes.shape[1] should be 4 or 5, but its {bboxes.shape[1]}.' img = mmcv.imread(img).astype(np.uint8) if score_thr > 0: assert bboxes.shape[1] == 5 scores = bboxes[:, -1] inds = scores > score_thr bboxes = bboxes[inds, :] labels = labels[inds] if segms is not None: segms = segms[inds, ...] mask_colors = [] if labels.shape[0] > 0: if mask_color is None: # Get random state before set seed, and restore random state later. # Prevent loss of randomness. # See: https://github.com/open-mmlab/mmdetection/issues/5844 state = np.random.get_state() # random color np.random.seed(42) mask_colors = [ np.random.randint(0, 256, (1, 3), dtype=np.uint8) for _ in range(max(labels) + 1) ] np.random.set_state(state) else: # specify color mask_colors = [ np.array(mmcv.color_val(mask_color)[::-1], dtype=np.uint8) ] * ( max(labels) + 1) bbox_color = color_val_matplotlib(bbox_color) text_color = color_val_matplotlib(text_color) img = mmcv.bgr2rgb(img) width, height = img.shape[1], img.shape[0] img = np.ascontiguousarray(img) fig = plt.figure(win_name, frameon=False) plt.title(win_name) canvas = fig.canvas dpi = fig.get_dpi() # add a small EPS to avoid precision lost due to matplotlib's truncation # (https://github.com/matplotlib/matplotlib/issues/15363) fig.set_size_inches((width + EPS) / dpi, (height + EPS) / dpi) # remove white edges by set subplot margin plt.subplots_adjust(left=0, right=1, bottom=0, top=1) ax = plt.gca() ax.axis('off') polygons = [] color = [] for i, (bbox, label) in enumerate(zip(bboxes, labels)): bbox_int = bbox.astype(np.int32) poly = [[bbox_int[0], bbox_int[1]], [bbox_int[0], bbox_int[3]], [bbox_int[2], bbox_int[3]], [bbox_int[2], bbox_int[1]]] np_poly = np.array(poly).reshape((4, 2)) polygons.append(Polygon(np_poly)) color.append(bbox_color) label_text = class_names[ label] if class_names is not None else f'class {label}' if len(bbox) > 4: label_text += f'|{bbox[-1]:.02f}' ax.text( bbox_int[0], bbox_int[1], f'{label_text}', bbox={ 'facecolor': 'black', 'alpha': 0.8, 'pad': 0.7, 'edgecolor': 'none' }, color=text_color, fontsize=font_size, verticalalignment='top', horizontalalignment='left') if segms is not None: color_mask = mask_colors[labels[i]] mask = segms[i].astype(bool) img[mask] = img[mask] * 0.5 + color_mask * 0.5 plt.imshow(img) p = PatchCollection( polygons, facecolor='none', edgecolors=color, linewidths=thickness) ax.add_collection(p) stream, _ = canvas.print_to_buffer() buffer = np.frombuffer(stream, dtype='uint8') img_rgba = buffer.reshape(height, width, 4) rgb, alpha = np.split(img_rgba, [3], axis=2) img = rgb.astype('uint8') img = mmcv.rgb2bgr(img) if show: # We do not use cv2 for display because in some cases, opencv will # conflict with Qt, it will output a warning: Current thread # is not the object's thread. You can refer to # https://github.com/opencv/opencv-python/issues/46 for details if wait_time == 0: plt.show() else: plt.show(block=False) plt.pause(wait_time) if out_file is not None: mmcv.imwrite(img, out_file) plt.close() return img 감사합니다
-
미해결비전공자를 위한 진짜 입문 올인원 개발 부트캠프
에러가 납니다ㅜㅜ
강의를 보며 그대로 따라했는데 const query = req.query; console.log("QUERY : ", query); 를 추가했을때 터미널에 node server.js를 하면 에러가 납니다ㅜㅜ
-
미해결딥러닝 CNN 완벽 가이드 - TFKeras 버전
선생님. 강의를 듣다보니, batch 크기와 관련하여 질문이 있습니다.
선생님. 강의를 듣다보니, batch 크기와 관련하여 질문이 있습니다. 강의 말미에 GPU는 batch크기가 클수록 학습이 빨라져서 속도가 빠르다고 하셨습니다. 그렇다면, H/W의 성능이 좋다는 가정하에, batch 크기를 증가시키면 같은 결과지만 속도가 빨라지는 차이만 있는것인가요? 아니면, 학습을 시키는 적정한 batch 사이즈가 있는것인가요?