목록전체 글 (424)
안 쓰던 블로그
steps_per_epoch steps_per_epoch = 훈련 샘플 수 / 배치 사이즈 예시1: 총 45개의 훈련 샘플이 있고 배치사이즈가 3이면 최대 15 스텝으로 지정한다 (그 이하 가능) 예시2: 총 80개의 훈련 샘플이 있고 배치사이즈가 10이면 최대 8 스텝으로 지정한다 사이즈가 너무 크면 이런 에러가 뜬다 Your input ran out of data; interrupting training. Make sure that your dataset or generator can generate at least `steps_per_epoch * epochs` batches (in this case, 150 batches). You may need to use the repeat() functio..
TensorFlow Developer Certificate Exam 1. Pycharm 프로젝트 하나 생성 파이썬 3.8로 설정한다 2. Settings-Project:프로젝트 이름-Python Interpreter- +클릭 필요 라이브러리 설치 2021.9.3 기준 버전은 다음과 같다 pip install numpy==1.19.5 터미널 창에서 이렇게 버전을 명시하여 설치해 주어도 된다 3. 버전 확인 import tensorflow_datasets as tfds import tensorflow as tf import keras as k import numpy as np import PIL as pil import pandas as pd import scipy as spy print('tensorflo..
Kaggle competiton 참가하면서 Cannot submit 에러를 많이 만났다 Your Notebook cannot use internet access in this competition 라는 에러가 뜨면서 제출이 되지 않는데, 해결은 간단한다 1. save할 때 Advanced Settings를 눌러서 "Save output for this version"으로 바꾼다 2. 캐글 노트북 우측 바에서 internet을 끈다 3. 다시 제출하면 해결
dropout을 적용한 forward propagation(순전파)을 계산할 때 주의할 점이 있다. 최종 cost가 dropout을 사용하지 않았을 때와 동일한 값을 유지하도록 마지막에 keep_prob값으로 나눠주는 것이다. 아래 순전파 코드가 있다. # GRADED FUNCTION: forward_propagation_with_dropout def forward_propagation_with_dropout(X, parameters, keep_prob = 0.5): """ Implements the forward propagation: LINEAR -> RELU + DROPOUT -> LINEAR -> RELU + DROPOUT -> LINEAR -> SIGMOID. Arguments: X -- inp..
케라스에서 커스텀 Attention(Layer)를 사용할 때 add_weight() got multiple values for argument 'name' 에러 1. class Attention(Layer) -> class Attention(keras.layers.Layer) 변경 2. add_weights 메소드 안에 Add shape=(...) 추가 두 가지로 해결 class Attention(tf.keras.layers.Layer): # 여기 def __init__(self, step_dim, ... def build(self, input_shape): assert len(input_shape) == 3 self.W = self.add_weight(shape=(input_shape[-1],), # ..