목록머신러닝/메모 및 에러 해결 (6)
안 쓰던 블로그

chkpoint_filepath = "best_model.h5" Mycallback = tf.keras.callbacks.ModelCheckpoint( filepath = chkpoint_filepath, monitor = "val_accuracy", #모델을 저장할 때 기준이 되는 값 save_weights_only = False, mode = "max", #for val_acc, this should be max save_best_only = True, save_freq = "epoch") 학습을 돌릴 때, 가장 결과가 좋았을 때의 모델을 저장하는 ModelCheckpoint를 많이 사용한다. 나도 항상 이것을 잘 사용을 해 왔다. 그런데 이번에 늘 쓰던 코드임에도 모델이 아예 생성되지 않는 에러가 ..

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. 다시 제출하면 해결
케라스에서 커스텀 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],), # ..
Parameter grid for parameter (early_stopping_round) needs to be a list or numpy array, but got (). Single values need to be wrapped in a list with one element. 아주 간단하지만 막상 봤을 때 왜 틀렸나 싶은 에러 params = { 'max_depth': [11], 'warm_start': True } 각 키의 값을 [ ]로 묶어준다 params = { 'max_depth': [11], 'warm_start': [True] }
Collecting package metadata (current_repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source conda install -c anaconda py-xgboost 로 설치했는데 뜨는 문제 방법 1. 업데이트 후 재설치 conda update --all 방법 2. pip으로 설치 pip install xgboost pip으로 설치해도 정상 동작했다