Q&A
前提・実現したいこと
SegNetプログラムを実行させる際、そのうちの学習用プログラムの実行の際に「カーネルを開始中にエラーが発生しました」というメッセージが表示されてしまいます。
実行時は以下のように数十分かけて学習が進んでいくですが、学習が完了した直後にエラーメッセージが突然現れ、動作が停止されてしまいます。
原因がまったくわからないので、これに対する解決策を教えていただきたいです。よろしくお願いいたします。
数十分経過後 ↓
発生している問題・エラーメッセージ
カーネルを開始中にエラーが発生しました 2018???????? 17:22:23.007931: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1432] Found device 0 with properties: name: GeForce GTX 570 major: 2 minor: 0 memoryClockRate(GHz): 1.464 pciBusID: 0000:06:00.0 totalMemory: 1.25GiB freeMemory: 1015.65MiB 2018???????? 17:22:23.007931: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1482] Ignoring visible gpu device (device: 0, name: GeForce GTX 570, pci bus id: 0000:06:00.0, compute capability: 2.0) with Cuda compute capability 2.0. The minimum required Cuda capability is 3.0. 2018???????? 17:22:23.017931: I tensorflow/core/common_runtime/gpu/gpu_device.cc:982] Device interconnect StreamExecutor with strength 1 edge matrix: 2018???????? 17:22:23.017931: I tensorflow/core/common_runtime/gpu/gpu_device.cc:988] 0 2018???????? 17:22:23.017931: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1001] 0: N 2018???????? 17:24:33.217214: W tensorflow/core/framework/allocator.cc:122] Allocation of 796262400 exceeds 10% of system memory. 2018???????? 17:24:33.222214: W tensorflow/core/framework/allocator.cc:122] Allocation of 796262400 exceeds 10% of system memory. 2018???????? 17:24:42.225729: W tensorflow/core/framework/allocator.cc:122] Allocation of 796262400 exceeds 10% of system memory. 2018???????? 17:24:42.225729: W tensorflow/core/framework/allocator.cc:122] Allocation of 796262400 exceeds 10% of system memory. 2018???????? 17:24:51.544262: W tensorflow/core/framework/allocator.cc:122] Allocation of 796262400 exceeds 10% of system memory.
該当のソースコード
import os import glob import numpy as np import keras from model import SegNet import dataset input_shape = (360, 480, 3) classes = 12 epochs = 100 batch_size = 1 log_filepath='./logs/' data_shape = 360*480 class_weighting = [0.2595, 0.1826, 4.5640, 0.1417, 0.5051, 0.3826, 9.6446, 1.8418, 6.6823, 6.2478, 3.0, 7.3614] ## set gpu usage import tensorflow as tf config = tf.ConfigProto(gpu_options=tf.GPUOptions(allow_growth=True, per_process_gpu_memory_fraction = 0.8)) session = tf.Session(config=config) keras.backend.tensorflow_backend.set_session(session) def main(): print("loading data...") ds = dataset.Dataset(classes=classes) train_X, train_y = ds.load_data('train') # need to implement, y shape is (None, 360, 480, classes) train_X = ds.preprocess_inputs(train_X) train_Y = ds.reshape_labels(train_y) print("input data shape...", train_X.shape) print("input label shape...", train_Y.shape) test_X, test_y = ds.load_data('test') # need to implement, y shape is (None, 360, 480, classes) test_X = ds.preprocess_inputs(test_X) test_Y = ds.reshape_labels(test_y) tb_cb = keras.callbacks.TensorBoard(log_dir=log_filepath, histogram_freq=1, write_graph=True, write_images=True) print("creating model...") model = SegNet(input_shape=input_shape, classes=classes) model.compile(loss="categorical_crossentropy", optimizer='adadelta', metrics=["accuracy"]) model.fit(train_X, train_Y, batch_size=batch_size, epochs=epochs, verbose=1, class_weight=class_weighting , validation_data=(test_X, test_Y), shuffle=True , callbacks=[tb_cb]) model.save('seg.h5') if __name__ == '__main__': main()
補足情報(FW/ツールのバージョンなど)
開発環境
- Windows7 (64bit)
- Anaconda Navigator
- Spyder (Python3.6)
- keras 2.2.4
- tensorflow 1.12.0
回答1件
あなたの回答
tips
プレビュー
下記のような回答は推奨されていません。
このような回答には修正を依頼しましょう。
2018/12/15 03:10
2018/12/15 03:18
2018/12/18 01:21
2018/12/18 01:54
2018/12/18 03:37
2018/12/18 04:38
2018/12/18 05:01
2018/12/19 03:09
2018/12/26 07:42