인공지능(AI)/TensorFlow

TensorFlow Error 2020/02/20

starcell 2020. 2. 20. 18:07

TensorFlow를 GPU에서 사용할 때 그리고 CNN을 사용할 때 에러가 많이 납니다.

오늘도 하나 에러가 나서 고생 좀 했습니다.

2020-02-20 17:11:38.802615: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcublas.so.10.0

2020-02-20 17:11:38.945746: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcudnn.so.7

2020-02-20 17:11:39.211419: E tensorflow/stream_executor/cuda/cuda_dnn.cc:329] Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR

2020-02-20 17:11:39.214920: E tensorflow/stream_executor/cuda/cuda_dnn.cc:329] Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR

 0%|                                                                   | 0/1237 [00:02<?, ?it/s]

Traceback (most recent call last):

 File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/client/session.py", line 1356, in _do_call

  return fn(*args)

 File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/client/session.py", line 1341, in _run_fn

  options, feed_dict, fetch_list, target_list, run_metadata)

 File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/client/session.py", line 1429, in _call_tf_sessionrun

  run_metadata)

tensorflow.python.framework.errors_impl.UnknownError: 2 root error(s) found.

 

-----> 이런 에러가 날 때 보통 다음과 같이 추가하면 해결이 됩니다.

config = tf.ConfigProto()

config.gpu_options.allow_growth = True

sess = tf.Session(config=config)