묻고 답해요
164만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결웹 게임을 만들며 배우는 React
3-9. React Devtools 강의를 듣다가 production으로 실행이 안되어 문의드립니다.
3-9. React Devtools 강의를 듣다가 react development tools 플러그인이 빨갛게 나와서production으로 모드를 바꾸어 줘야 된다고 강의에서 설명 주셨는데요.webpack.config.js 파일에서 아래 두 부분을 변경하고 실행하였는데 오류가 납니다 process.env.NODE_ENV = 'production'; mode : 'production', const path = require('path'); const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin'); process.env.NODE_ENV = 'production'; module.exports = { name : 'numberBaseball-setting', mode : 'production', devtool : 'eval', resolve : { extensions : ['.js','.jsx'] }, entry : { app : './client', }, module : { rules : [{ test : /\.jsx?$/, loader : 'babel-loader', options : { presets : [ ['@babel/preset-env', { targets : { browsers : ['> 1% in KR'], //browserslist }, debug : true, }], '@babel/preset-react' ], plugins : ['react-refresh/babel'], }, exclude: path.join(__dirname, 'node_modules'), }] }, plugins : [ new ReactRefreshWebpackPlugin(), ], output:{ path : path.join(__dirname,'dist'), filename : 'app.js', publicPath : '/dist', }, devServer : { // 새로 추가됨 devMiddleware: { publicPath: '/dist' }, // 실제로 존재하는 정적 파일의 경로 static: { directory: path.resolve(__dirname) }, hot: true } }
-
미해결일주일 만에 소프트웨어 요구사항 제대로 이해하기
혹시 강의자료를 공유받을수는 없을까요?
혹시 강의자료를 공유 받을수는 없을까요? 강의를 들으면서 필기를 하는데 용이할 것 같습니다.
-
미해결15일간의 빅데이터 파일럿 프로젝트
미러리스트
파이썬 버전 2.7을 설치하는 과정에서 미러리스트가 삭제되었다고 하셨고 강의 소식에 있는 명령어 다섯줄을 그대로 복사 붙여넣기 했습니다만 다음과 같이 no such file or directory 라고 뜹니다! 제가 실수한 것이 있을까요?
-
미해결파이썬 알고리즘 문제풀이 입문(코딩테스트 대비)
if else 들여쓰기
섹션3 1번 회문 문자열 검사에서else를 if 보다 앞쪽에 썼는데 이렇게 쓰는 방식이 생소해서 질문드립니다. 보통 else 랑 if를 같은 들여쓰기를 취하는데여기서는 for else로 사용한 것 같습니다. 이렇게 사용하시는 이유와 장점에 대해서 궁금합니다.n = int(input())for i in range(n): s = input() s = s.upper() size=len(s) for j in range(size//2): if s[j] != s[-j-1]: print("#%d NO" %(i+1)) break else: print("#%d YES" %(i+1))
-
미해결15일간의 빅데이터 파일럿 프로젝트
우지 설치
대용량 파일 적재 실습 후 실시간 데이터 적재는 실습하지 않고 바로 탐색 챕터로 넘어왔습니다, 다만 Hbase를 실시간 데이터 적재 챕터에서 설치하시기에 그것만 보고 따라했습니다.!그런데 현재 우지 설치과정중에 사진과 같이 Hbase가 뜨지 않습니다. Hbase가 포함된 디펜던시를 선택하라고 강의중에 말씀하셔서 조금 걱정이 됩니다. 괜찮을까요?
-
미해결Nuxt.js 시작하기
router.js 설정을 변경할 수 있는 방법이 있나요?
vue 파일을 생성하면router.js 파일에 자동으로 라우트 정보가 설정되잖아요이때 name 값은 파일명과 다르게 설정을 하고 싶습니다.직접 router.js 파일을 변경하면 재기동 하면서 원복 돼버리네요
-
해결됨앨런 iOS 앱 개발 (15개의 앱을 만들면서 근본원리부터 배우는 UIKit) - MVVM까지
Value of type 'UILabel' has no member 'image'
기초앱12강, 10:23 입니다.구글링을 해보고 다양하게 시도해보았는데요. 해결이 되지않았습니다
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
http://localhost:8080/hello 404 error
[질문 내용]java11 버전으로 실행하였고 강사님 코드 그대로 따라서 작성하였습니다. 하지만 계속 404에러가 뜹니다ㅜ springboot version: 2.7.4hello.html<!DOCTYPE HTML> <html xmlns:th="http://www.thymeleaf.org"> <head> <title>Hello</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> </head> <body> <p th:text="'안녕하세요. ' + ${data}" >안녕하세요. 손님</p> </body> </html>
-
미해결자바(Java) 알고리즘 문제풀이 입문: 코딩테스트 대비
피보나치 수열 오답
2.4.피보나치수열 아래 코드로 오류가 나오는데 왜인지 모르겠습니다... import java.util.*; public class Main { public int[] solution(int n){ int[] answer=new int[n]; answer[0]=1; answer[1]=1; for(int i=2; i<n; i++){ answer[i]=answer[i-2]+answer[i-1]; } return answer; } public static void main(String[] args){ Main T = new Main(); Scanner kb = new Scanner(System.in); int n = kb.nextInt(); for(int x : T.solution(n)) System.out.println(x+" "); } }
-
해결됨자바 ORM 표준 JPA 프로그래밍 - 기본편
파라미터 바인딩
강의에서는 파라미터 바인딩을 이름 기반으로 해라 정도만 나와있습니다.그런데 , 이 파라미터 바인딩이 무엇이고, 이걸 왜 쓰는지 이런 설명이 없다보니 이해가 되지 않습니다. 파라미터 조인으로 뭘 하는 건가요?ㅠㅠList<Member> resultList = em.createQuery("select m from Member m inner join m.team t " + "where t.name = :teamname", Member.class) .getResultList();
-
해결됨취미로 해킹#1(OverTheWire - Bandit)
bandit계정으로 로그인한 후 ssh나 git으로 연결하려고 하면 안되요 ㅠㅠ
bandit27@bandit:/tmp/myclone1$ git clone ssh://bandit27-git@localhost/home/banidt27-git/repoCloning into 'repo'...The authenticity of host 'localhost (127.0.0.1)' can't be established.ED25519 key fingerprint is SHA256:C2ihUBV7ihnV1wUXRb4RrEcLfXC5CXlhmAAM/urerLY.This key is not known by any other namesAre you sure you want to continue connecting (yes/no/[fingerprint])? yesCould not create directory '/home/bandit27/.ssh' (Permission denied).Failed to add the host to the list of known hosts (/home/bandit27/.ssh/known_hosts). This is an OverTheWire game server. More information on http://www.overthewire.org/wargames!!! You are trying to log into this SSH server on port 22, which is not intended.bandit27-git@localhost: Permission denied (publickey).fatal: Could not read from remote repository.Please make sure you have the correct access rightsand the repository exists.동영상대로 해보면 위와 같이 나오고 password 치기도 전에 연결이 끊기는데 왜 그런지 알 수 있을까요???
-
미해결(2025 최신 업데이트)리액트 : 프론트엔드 개발자로 가는 마지막 단계
프로젝트 진행하다가 오류가 나서 더이상 진행을 못하고 있습니다 ㅠ
CORS오류가 났는데 어떻게 해결하면 좋을까요 ㅠ??
-
미해결[리뉴얼] Node.js 교과서 - 기본부터 프로젝트 실습까지
9.5.1 스스로 해보기 관련
안녕하세요9.5.1 스스로 해보기에 추가 학습으로 좋아요/좋아요 취소 버튼을 만들었습니다.이제 각 게시물에 좋아요 누른 사람의 목록을 input 창에 나열시키고 싶습니다.전제조건 : 로그인과 관계없이 누구나 그 목록을 볼 수 있습니다. models/post.js db.Post.belongsToMany(db.User, { as: "User2", through: "Like" });models/user.jsdb.User.belongsToMany(db.Post, { as: "Post2", through: "Like" }); }routes/page.jsrouter.get("/", async (req, res, next) => { try { const posts = await Post.findAll({ include: [ { model: User, attributes: ["id", "nick"], }, { model: User, attributes: ["nick"], as: "User2", }, ], order: [["createdAt", "DESC"]], }); res.render("main", { title: "NodeBird", twits: posts, }); } catch (err) { console.error(err); next(err); } });추가한 코드는 아래와 같습니다.{ model: User, attributes: ["nick"], as: "User2", },views/main.html {% for twit in twits %} <div class="twit"> <input type="hidden" value="{{twit.User.id}}" class="twit-user-id" /> <input type="hidden" value="{{twit.id}}" class="twit-id" /> <div class="twit-author">{{twit.User.nick}}</div> {% if not followingIdList.includes(twit.User.id) and twit.User.id !==user.id %} <button class="twit-follow">팔로우하기</button> {% endif %} <!-- '수정', '삭제' 버튼 --> {% if user.id === twit.User.id %} <button class="twit-delete">삭제</button> <button class="twit-update">수정</button> {% endif %} <!-- 게시글, 이미지 --> <br /> <br /> <div class="twit-content">{{twit.content}}</div> {% if twit.img %} <br /> <div class="twit-img"><img src="{{twit.img}}" alt="섬네일" /></div> {% endif %} <br /> {% if not likeIdList.includes(twit.id) %} <!-- 좋아요 안 누른 상태 --> <button class="twit-like" style="cursor: pointer"> <img src="../notlike.png" class="twit-notlike-icon" /> </button> {% else %} <!-- 좋아요 이미 누른 상태 (취소하고 싶다면) --> <button class="twit-notlike" style="cursor: pointer"> <img src="../like.png" class="twit-like-icon" /> </button> {% endif %} <!-- 좋아요를 누른 사람들 목록 --> <input type="text" value="{{twit.User2.nick}}" /> </div> {% endfor %}추가한 코드는 아래와 같습니다 <input type="text" value="{{twit.User2.nick}}" /> [결과]웹에서 input 상자가 빈 상자로 나옵니다. 개발자 도구 Elements에는 다음과 같이 나옵니다어디부터 잘못된 걸까요..?
-
미해결스프링 MVC 2편 - 백엔드 웹 개발 활용 기술
프로퍼티에 지정한 값을 어떻게 중괄호에서 바로 사용이 가능한건가요??
[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오) 예2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 예3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오) 예[질문 내용]여기에 질문 내용을 남겨주세요. 안녕하세요. 강사님 수업 잘 듣고 있습니다.다름이 아니라 addItemV3 로 변경하면서errors.properties 파일을 만들어서 안에 있는 값을new String[]에 담아서 사용하는 부분이 잘 이해가안되서 질문 남깁니다.어떻게 @Value 같은 어노테이션도 없이 프로퍼티파일과동일한 변수를 찍어서 중괄호에서 바로 사용이 가능한건지잘 이해가 안갑니다.. 감사합니다..
-
미해결스프링 시큐리티
[질문] SecurityFilterChain 방식에서 질문드립니다.
안녕하세요 강사님. 저는 아래와 같이 하였는데 null 에러가 나서 질문드려요. 소스도 공유합니다.깃헙 : https://github.com/DongWoonKim/core-spring-security-ajax@Bean AuthenticationManager authenticationManager1 (HttpSecurity http) throws Exception { return http.getSharedObject(AuthenticationManager.class); }http .addFilterBefore(new AjaxLoginProcessingFilter() , UsernamePasswordAuthenticationFilter.class );error message{ "timestamp": "2022-09-28T12:58:47.088+00:00", "status": 500, "error": "Internal Server Error", "trace": "java.lang.NullPointerException: Cannot invoke \"org.springframework.security.authentication.AuthenticationManager.authenticate(org.springframework.security.core.Authentication)\" because the return value of \"com.example.corespringsecurityajax.security.filter.AjaxLoginProcessingFilter.getAuthenticationManager()\" is null\n\tat com.example.corespringsecurityajax.security.filter.AjaxLoginProcessingFilter.attemptAuthentication(AjaxLoginProcessingFilter.java:39)\n\tat org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:227)\n\tat org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:217)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)\n\tat org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103)\n\tat org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)\n\tat org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90)\n\tat org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)\n\tat org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:112)\n\tat org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:82)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)\n\tat org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)\n\tat org.springframework.security.web.session.DisableEncodeUrlFilter.doFilterInternal(DisableEncodeUrlFilter.java:42)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)\n\tat org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:221)\n\tat org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:186)\n\tat org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354)\n\tat org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)\n\tat org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)\n\tat org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)\n\tat org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)\n\tat org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)\n\tat org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)\n\tat org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)\n\tat org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)\n\tat org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)\n\tat org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)\n\tat org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)\n\tat org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)\n\tat org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)\n\tat org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890)\n\tat org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1789)\n\tat org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)\n\tat org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)\n\tat org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)\n\tat org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)\n\tat java.base/java.lang.Thread.run(Thread.java:833)\n", "message": "Cannot invoke \"org.springframework.security.authentication.AuthenticationManager.authenticate(org.springframework.security.core.Authentication)\" because the return value of \"com.example.corespringsecurityajax.security.filter.AjaxLoginProcessingFilter.getAuthenticationManager()\" is null", "path": "/api/login"}
-
미해결스프링 핵심 원리 - 기본편
asserThat Cannot Resolve 에러
import도 안되궁 스프링 버젼은 2.7.X버젼인거 같은뎅용 임포트 방법을 모르겠네욤
-
미해결Spring Cloud로 개발하는 마이크로서비스 애플리케이션(MSA)
innodb 관련 에러
안녕하세요!뒤늦게 강의를 수강하고 있습니다.현재 mariadb docker build 후에 docker run을 하게 되면 아래와 같은 에러가 발생합니다.구글링을 해도 방법을 찾을 수가 없어요 ㅜㅜ[Dockerfile][Docker logs mariadb]어떻게 해결해야 할까요?...
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 레딧 사이트 만들기(NextJS)(Pages Router)
cookie-parser Invalid or unexpected token error
영상에 따라서 단순하게 cookie-parser 설치하고 import cookie-parser 한다음에 app.use(cookieParser()) 진행하면 상단에 이미지처럼 에러가 발생하더라구요. cookie-parser을 제거하면 cookie가 정상적으로 저장되는 것을 볼 수 있었습니다. 어떤 부분을 놓친 것일까요server.tsimport express from "express"; import morgan from "morgan"; import { AppDataSource } from "./data-source" import authRoutes from "./routes/auth"; import subRoutes from "./routes/subs"; import cors from 'cors'; import dotenv from 'dotenv'; import cookieParser from "cookie-parser"; const app = express(); dotenv.config(); app.use(cors({ origin: process.env.ORIGIN, credentials: true })) app.use(express.json()); app.use(morgan('dev')); app.use(cookieParser()) app.get("/", (_, res) => res.send("running")); app.use('/api/auth', authRoutes); app.use("/api/subs", subRoutes); const PORT = process.env.PORT; console.log('PORT', PORT) app.listen(PORT, async () => { console.log(`server running at http://localhost:${PORT}`); AppDataSource.initialize().then(async () => { console.log("data initialize...") }).catch(error => console.log(error)) })
-
해결됨
Keras-yolo3 (FileNotFoundError: [Errno 2] No such file or directory: 'c:/test/images1\\hardhatvest') 에러
keras-yolo3로 학습을 하려고 했는데 도저히 에러 발생에서 해결을 못하겠습니다.... 주피터 노트북에서 실행했습니다"""Retrain the YOLO model for your own dataset."""import osfrom pathlib import PathHOME_DIR = 'C:/test/'ANNO_DIR = 'C:/test/label_xml/'#xml 파일들IMAGE_DIR = 'c:/test/images1/'#이미지 파일들print(ANNO_DIR)print(IMAGE_DIR)files = os.listdir(ANNO_DIR)files2 = os.listdir(IMAGE_DIR)print('파일 개수는:',len(files))print('파일 개수는:',len(files2)) import numpy as npimport tensorflow.keras.backend as Kfrom keras.layers import Input, Lambdafrom keras.models import *from keras.optimizers import Adamfrom keras.callbacks import TensorBoard, ModelCheckpoint, ReduceLROnPlateau, EarlyStoppingfrom tensorflow.python.ops import control_flow_ops import sysLOCAL_PACKAGE_DIR = os.path.abspath("c:/test/SED")sys.path.append(LOCAL_PACKAGE_DIR)from yolo3.model import preprocess_true_boxes, yolo_body, tiny_yolo_body, yolo_lossfrom yolo3.utils import get_random_datafrom train import get_classes, get_anchorsfrom train import create_model, data_generator, data_generator_wrapper annotation_path = 'c:/test/label_xml/annotation.csv'log_dir = 'c:/test/logs/000/'classes_path = 'c:/test/model_data/voc_classes.txt'anchors_path = 'c:/test/model_data/yolo_anchors.txt'class_names = get_classes(classes_path)num_classes = len(class_names)anchors = get_anchors(anchors_path)model_weights_path = 'c:/test/model_data/yolo.h5'input_shape = (416,416) is_tiny_version = len(anchors)==6 # default setting# create_tiny_model(), create_model() 함수의 인자 설정을 원본 train.py에서 수정.if is_tiny_version:model = create_tiny_model(input_shape, anchors, num_classes,freeze_body=2, weights_path=model_weights_path)else:# create_model 은 해당 패키지의 tarin.py 내부에 있는 클래스를 사용했다. 이 함수는 keras 모듈이 많이 사용한다. 우선 모르는 건 pass하고 넘어가자.model = create_model(input_shape, anchors, num_classes,freeze_body=2, weights_path=model_weights_path) # make sure you know what you freeze# epoch 마다 call back 하여 모델 파일 저장.# 이것 또한 Keras에서 많이 사용하는 checkpoint 저장 방식인듯 하다. 우선 이것도 모르지만 넘어가자.logging = TensorBoard(log_dir=log_dir)checkpoint = ModelCheckpoint(log_dir + 'ep{epoch:03d}-loss{loss:.3f}-val_loss{val_loss:.3f}.h5',monitor='val_loss', save_weights_only=True, save_best_only=True, period=3)reduce_lr = ReduceLROnPlateau(monitor='val_loss', factor=0.1, patience=3, verbose=1)early_stopping = EarlyStopping(monitor='val_loss', min_delta=0, patience=10, verbose=1) val_split = 0.1 # train data : val_data = 9 : 1with open(annotation_path) as f:# 이러니 annotation 파일이 txt이든 csv이든 상관없었다.lines = f.readlines()# 랜덤 시드 생성 및 lines 셔플하기np.random.seed(10101)np.random.shuffle(lines)np.random.seed(None)# 데이터셋 나누기num_val = int(len(lines)*val_split)num_train = len(lines) - num_val # 여기서 부터 진짜 학습 시작!# create_model() 로 반환된 yolo모델에서 trainable=False로 되어 있는 layer들 제외하고 학습if True:# optimizer와 loss 함수 정의# 위에서 사용한 create_model 클래스의 맴버함수를 사용한다.model.compile(optimizer=Adam(lr=1e-3), loss={# use custom yolo_loss Lambda layer.'yolo_loss': lambda y_true, y_pred: y_pred})batch_size = 4print('Train on {} samples, val on {} samples, with batch size {}.'.format(num_train, num_val, batch_size)) # foward -> backpropagation -> weight 갱신 -> weight 저장# checkpoint 만드는 것은 뭔지 모르겠으니 pass...model.fit_generator(data_generator_wrapper(lines[:num_train], batch_size, input_shape, anchors, num_classes),steps_per_epoch=max(1, num_train//batch_size),validation_data=data_generator_wrapper(lines[num_train:], batch_size, input_shape, anchors, num_classes),validation_steps=max(1, num_val//batch_size),epochs=50,initial_epoch=0,callbacks=[logging, checkpoint])model.save_weights(log_dir + 'trained_weights_stage_1.h5')# create_model() 로 반환된 yolo모델에서 trainable=False로 되어 있는 layer들 없이, 모두 True로 만들고 다시 학습if True:for i in range(len(model.layers)):model.layers[i].trainable = Truemodel.compile(optimizer=Adam(lr=1e-4), loss={'yolo_loss': lambda y_true, y_pred: y_pred}) # recompile to apply the changeprint('Unfreeze all of the layers.')batch_size = 4 # note that more GPU memory is required after unfreezing the bodyprint('Train on {} samples, val on {} samples, with batch size {}.'.format(num_train, num_val, batch_size))model.fit_generator(data_generator_wrapper(lines[:num_train], batch_size, input_shape, anchors, num_classes),steps_per_epoch=max(1, num_train//batch_size),validation_data=data_generator_wrapper(lines[num_train:], batch_size, input_shape, anchors, num_classes),validation_steps=max(1, num_val//batch_size),epochs=100,initial_epoch=50,callbacks=[logging, checkpoint, reduce_lr, early_stopping])model.save_weights(log_dir + 'trained_weights_final.h5')이렇게 해주고 실행을 했습니다. 이미지 경로도 제대로 설정해줬는데 파일이나 폴더를 찾을 수가 없다고 하는데 어떻게 해주어야 할까요....저 images1 폴더를 다른 이름으로 수정하거나 없애도 경로가 계속 'c:/test/images1\\hardhatvest' 이곳을 가리킵니다. Train on 29 samples, val on 3 samples, with batch size 4. Epoch 1/50 --------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) ~\AppData\Local\Temp\ipykernel_20040\2424985784.py in <module> 20 epochs=50, 21 initial_epoch=0, ---> 22 callbacks=[logging, checkpoint]) 23 model.save_weights(log_dir + 'trained_weights_stage_1.h5') 24 ~\anaconda3\envs\test\lib\site-packages\keras\legacy\interfaces.py in wrapper(*args, **kwargs) 89 warnings.warn('Update your `' + object_name + '` call to the ' + 90 'Keras 2 API: ' + signature, stacklevel=2) ---> 91 return func(*args, **kwargs) 92 wrapper._original_function = func 93 return wrapper ~\anaconda3\envs\test\lib\site-packages\keras\engine\training.py in fit_generator(self, generator, steps_per_epoch, epochs, verbose, callbacks, validation_data, validation_steps, validation_freq, class_weight, max_queue_size, workers, use_multiprocessing, shuffle, initial_epoch) 1730 use_multiprocessing=use_multiprocessing, 1731 shuffle=shuffle, -> 1732 initial_epoch=initial_epoch) 1733 1734 @interfaces.legacy_generator_methods_support ~\anaconda3\envs\test\lib\site-packages\keras\engine\training_generator.py in fit_generator(model, generator, steps_per_epoch, epochs, verbose, callbacks, validation_data, validation_steps, validation_freq, class_weight, max_queue_size, workers, use_multiprocessing, shuffle, initial_epoch) 183 batch_index = 0 184 while steps_done < steps_per_epoch: --> 185 generator_output = next(output_generator) 186 187 if not hasattr(generator_output, '__len__'): ~\anaconda3\envs\test\lib\site-packages\keras\utils\data_utils.py in get(self) 740 "`use_multiprocessing=False, workers > 1`." 741 "For more information see issue #1638.") --> 742 six.reraise(*sys.exc_info()) ~\anaconda3\envs\test\lib\site-packages\six.py in reraise(tp, value, tb) 717 if value.__traceback__ is not tb: 718 raise value.with_traceback(tb) --> 719 raise value 720 finally: 721 value = None ~\anaconda3\envs\test\lib\site-packages\keras\utils\data_utils.py in get(self) 709 try: 710 future = self.queue.get(block=True) --> 711 inputs = future.get(timeout=30) 712 self.queue.task_done() 713 except mp.TimeoutError: ~\anaconda3\envs\test\lib\multiprocessing\pool.py in get(self, timeout) 655 return self._value 656 else: --> 657 raise self._value 658 659 def _set(self, i, obj): ~\anaconda3\envs\test\lib\multiprocessing\pool.py in worker(inqueue, outqueue, initializer, initargs, maxtasks, wrap_exception) 119 job, i, func, args, kwds = task 120 try: --> 121 result = (True, func(*args, **kwds)) 122 except Exception as e: 123 if wrap_exception and func is not _helper_reraises_exception: ~\anaconda3\envs\test\lib\site-packages\keras\utils\data_utils.py in next_sample(uid) 648 The next value of generator `uid`. 649 """ --> 650 return six.next(_SHARED_SEQUENCES[uid]) 651 652 c:\test\train.py in data_generator(annotation_lines, batch_size, input_shape, anchors, num_classes) 177 if i==0: 178 np.random.shuffle(annotation_lines) --> 179 image, box = get_random_data(annotation_lines[i], input_shape, random=True) 180 image_data.append(image) 181 box_data.append(box) c:\test\yolo3\utils.py in get_random_data(annotation_line, input_shape, random, max_boxes, jitter, hue, sat, val, proc_img) 37 '''random preprocessing for real-time data augmentation''' 38 line = annotation_line.split() ---> 39 image = Image.open(line[0]) 40 iw, ih = image.size 41 h, w = input_shape ~\anaconda3\envs\test\lib\site-packages\PIL\Image.py in open(fp, mode, formats) 3090 3091 if filename: -> 3092 fp = builtins.open(filename, "rb") 3093 exclusive_fp = True 3094 FileNotFoundError: [Errno 2] No such file or directory: 'c:/test/images1\\hardhatvest'
-
미해결풀스택을 위한 도커와 최신 서버 기술(리눅스, nginx, AWS, HTTPS, 배포까지) [풀스택 Part3]
도커 강의자료 문의(메일 보냈으나 권한 부여가 안되어 있는 것 같습니다)
안녕하세요.강의자료를 사전에 '수업준비' 챕터에서 받았는데,본 docker 챕터부터 강의자료가 없는것 같아요.아니면, 강의자료가 다른곳에 첨부되어 있을까요?권한 부여된 자료를 어디서 확인할 수 있는지 모르겠습니다. 메일은 2021. 12. 26. 오후 2:03에 보냈습니다. 혹시 몰라서 오늘 다시 보냈습니다.확인 한번만 부탁드립니다. 인프런 아이디hajuny129@gmail.com구글 이메일hajuny129@gmail.com