Keras

【エラー】google.auth.exceptions.DefaultCredentialsError: Could not automatically determine credentials. Please set GOOGLE_APPLICATION_CREDENTIALS or explicitly create credentials and re-run the application

エラー $ docker-compose up <SEVICE_NAME> google.auth.exceptions.DefaultCredentialsError: Could not automatically determine credentials. Please set GOOGLE_APPLICATION_CREDENTIALS or explicitly create credentials and re-run the application. For more info</sevice_name>…

【Kerasエラー】Your generator is NOT thread-safe.Keras requires a thread-safe generator when`use_multiprocessing=False, workers > 1`.For more information see issue #1638.

環境 Ubuntu: 16.04 Python: 3.6 Tensorflow: 1.9.0 Keras: 2.2.0 NVIDIA Driver: 410.72 CUDA: 10.0 エラー内容 GCPで学習していたら、他のサーバでは出なかったエラーに遭遇した。 Epoch1の重みを保存した後にEpoch2〜38に以下のエラーが一気に出力され、E…

【keras】weightの中身をみるために「RuntimeError: maximum recursion depth exceeded」と「RecursionError: cannot set the recursion limit the limit is too low」を解決

やりたいこと 画像補完のプログラムを作成しているが、学習によって作成されたweightの中にnanが混ざり込んでいてうまく画像が生成されず真っ黒の画像が出てきてしまう。 そこでweight(h5ファイル)の中身を見てどこがnanになっているか確認したい。 方針1:g…

【Keras】ResourceExhaustedError: OOM when allocating tensor with shape[16,64,256,512]

問題点 学習時の画像サイズを256x256から、256x512に変更したところ、エラーが発生した。 tensorflow.python.framework.errors_impl.ResourceExhaustedError: OOM when allocating tensor with shape[16,64,256,512] and type float on /job:localhost/repli…

keras-deeplab-v3-plusで人だけとってみる

github.com Semantic Segmentationで人をとってきたいのでこのアーキテクチャを使って人と背景を分ける。 準備 # 仮想環境の準備 $ conda create -n keras-deeplab-v3-plus $ source activate keras-deeplab-v3-plus # モジュールインストール $ conda insta…

Kerasで「AttributeError: 'NoneType' object has no attribute HOGEHOGE」

エラー Kerasで重みを読み込む時に以下のエラー。 model_50 = model_50.load_weights('/host/weights/weights.013-7.248.hdf5') # AttributeError: 'NoneType' object has no attribute 'load_weights' NoneType。。。 print(type(model_50)) # <class 'NoneType'> 解決策 代入</class>…

Kerasで「ImportError: Could not import PIL.Image. The use of `array_to_img` requires PIL.」とPILのエラーが出る

エラー ローカルではこのエラー見たことなかったんだけど、サーバ側で実行したらPILに関するエラーが。 Kerasで以下のようにimportしてるのにだめなのか…。 from keras.preprocessing.image import ( ImageDataGenerator, load_img, img_to_array, array_to_…

【Keras】超個人的な遭遇したエラーと解決法メモ

結論 どこで何を出力し、どんな役割を担っているのか一つずつ理解しながら進める。 TnsorBoardにグラフが描画されない バッチサイズは適当か確認する。 バッチサイズが64なのに、テスト段階なので、validationのデータ数を10にしていて検証されない→グラフが…

KerasでGPUを使う際に「could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR Segmentation fault (core dumped)」が発生

GPUが割り当てられない import cv2 import numpy as np import glob import os : import keras.callbacks import keras.backend.tensorflow_backend as KTF import tensorflow as tf old_session = KTF.get_session() session = tf.Session('') KTF.set_sess…

【自分用メモ】OpenCVで輪郭を切り抜くときに参考にしたサイト一覧

輪郭抽出 配列操作 — opencv 2.2 documentation Canny法によるエッジ検出 — OpenCV-Python Tutorials 1 documentation 画像の勾配 — OpenCV-Python Tutorials 1 documentation モルフォロジー変換 — OpenCV-Python Tutorials 1 documentation ー 輪郭: 初めの…