Python sklearnのlog_lossでValueError: y_true contains only one label (0). 2値分類タスクでKfold分割してloglossを計算した時にエラー。 from sklearn.metrics import log_loss loss = log_loss(y_valdation, oof_prediction) Va... 2020.10.17 Python
Python Macのpyenvでconfigure: error: C compiler cannot create executables Macでpyenv installしようとしたところ表題のエラー。 % pyenv install 3.8.4 python-build: use openssl@1.1 from homebrew python-build: use re... 2020.10.16 Python
Deep Learning 転移学習やファインチューニングをしたモデルでGrad-CAMをしたらValueError: Graph disconnected 転移学習やファインチューニングをしたモデルでGrad-CAMを試そうとしたところ、エラー発生。 構築したモデルはこれ。 base = VGG16(input_shape=(224, 224, 3), weights='imagenet', ... 2020.10.14 Deep Learning
Deep Learning Kerasでのload_modelでエラー ValueError: Cannot create group in read-only mode. ModelCheckpointで保存した重みを tensorflow.keras.models.load_model で読み込むと表題のエラー。 ModelCheckpoint の save_weight_only = True にしていた... 2020.10.13 Deep Learning
Deep Learning KerasでエラーUnboundLocalError: local variable ‘logs’ referenced before assignment tensorflow.kerasでmodel.fit()を実行した時に表題のエラー。 (中略)in fit epoch_logs = copy.copy(logs) UnboundLocalError: local variable 'lo... 2020.10.05 Deep Learning
Deep Learning stringのTFRecordを作る時にTypeError 猫の画像とラベルを含んだTFRecordを作ろうとして表題のエラー。 TypeError: 'cat' has type str, but expected one of: bytes 使ったコードは公式チュートリアルに記載のもの。 def... 2020.09.28 Deep Learning
AtCoder AtCoder Beginner Contest 179の感想 ABC179に参加した。 A - Plural Form やるだけ。 Pythonは足し算みたいに文字列を扱えるので楽ちん。 s = input() print(s + 's') if s != 's' else print(s + 'es... 2020.09.22 AtCoder
Linux SSHでエラー kex_exchange_identification: read: Connection reset by pee クライアントの固定IPを変えた後にリモートサーバーにSSHしたら表題のエラー。 kex_exchange_identification: read: Connection reset by pee ファイアウォール(UFW)には新しいIPア... 2020.09.15 2023.07.14 Linux
AtCoder AtCoder Beginner Contest 178の感想 ABC178に参加した。 A - Not 0を1、1を0にする。 1-xを計算するか、1と排他的論理和 1^x を取ればOK。 x = int(input()) ans = 1 - x print(ans) B - Product Max ... 2020.09.14 2020.09.17 AtCoder
Python Pythonのitertoolsで順列や組合せを重複あり・なしで全列挙する 順列や組合せを求めたいときに、ネストしたループを組むと可読性が低いしネストの回数が変わるとコードの保守も面倒くさい。 itertoolsを使えば、読みやすいコードで全列挙を簡単にしてくれる。 組合せイテレータは全部で4種類。 abcという文... 2020.09.10 Python