コッコ

AtCoder

AtCoder Beginner Contest 180の感想

ABC180をコンテスト後に解いた。A - boxやるだけ。n, a, b = map(int, input().split())ans = n - a + bprint(ans)B - Various distancesnumpyやsci...
Python

sklearnのlog_lossでValueError: y_true contains only one label (0).

2値分類タスクでKfold分割してloglossを計算した時にエラー。from sklearn.metrics import log_lossloss = log_loss(y_valdation, oof_prediction)Value...
Python

Macのpyenvでconfigure: error: C compiler cannot create executables

Macでpyenv installしようとしたところ表題のエラー。% pyenv install 3.8.4python-build: use openssl@1.1 from homebrewpython-build: use readl...
Deep Learning

転移学習やファインチューニングをしたモデルでGrad-CAMをしたらValueError: Graph disconnected

転移学習やファインチューニングをしたモデルでGrad-CAMを試そうとしたところ、エラー発生。構築したモデルはこれ。base = VGG16(input_shape=(224, 224, 3), weights='imagenet', in...
Deep Learning

Kerasでのload_modelでエラー ValueError: Cannot create group in read-only mode.

ModelCheckpointで保存した重みを tensorflow.keras.models.load_model で読み込むと表題のエラー。ModelCheckpoint の save_weight_only = True にしていたの...
Deep Learning

KerasでエラーUnboundLocalError: local variable ‘logs’ referenced before assignment

tensorflow.kerasでmodel.fit()を実行した時に表題のエラー。(中略)in fit epoch_logs = copy.copy(logs) UnboundLocalError: local variable 'log...
Deep Learning

stringのTFRecordを作る時にTypeError

猫の画像とラベルを含んだTFRecordを作ろうとして表題のエラー。TypeError: 'cat' has type str, but expected one of: bytes使ったコードは公式チュートリアルに記載のもの。def _b...
AtCoder

AtCoder Beginner Contest 179の感想

ABC179に参加した。A - Plural Formやるだけ。Pythonは足し算みたいに文字列を扱えるので楽ちん。s = input()print(s + 's') if s != 's' else print(s + 'es')B -...
Linux

SSHでエラー kex_exchange_identification: read: Connection reset by pee

クライアントの固定IPを変えた後にリモートサーバーにSSHしたら表題のエラー。kex_exchange_identification: read: Connection reset by peeファイアウォール(UFW)には新しいIPアドレ...
AtCoder

AtCoder Beginner Contest 178の感想

ABC178に参加した。A - Not0を1、1を0にする。1-xを計算するか、1と排他的論理和 1^x を取ればOK。x = int(input())ans = 1 - xprint(ans)B - Product Max愚直に考えると二...