golbin / TensorFlow-Tutorials

텐서플로우를 기초부터 응용까지 단계별로 연습할 수 있는 소스 코드를 제공합니다

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error in 02 - Deep NN.py

artie88 opened this issue · comments

이 file 을 돌려보면 아래와 같은 에러가 나타납니다.

...
Caused by op 'MatMul', defined at:
File "02 - Deep NN.py", line 37, in
L1 = tf.add(tf.matmul(X, W1), b1)
File "C:\Users\artie\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\ops\math_ops.py", line 1891, in matmul
a, b, transpose_a=transpose_a, transpose_b=transpose_b, name=name)
File "C:\Users\artie\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\ops\gen_math_ops.py", line 2436, in _mat_mul
name=name)
File "C:\Users\artie\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "C:\Users\artie\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\framework\ops.py", line 2956, in create_op
op_def=op_def)
File "C:\Users\artie\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\framework\ops.py", line 1470, in init
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access

InternalError (see above for traceback): Blas GEMM launch failed : a.shape=(6, 2), b.shape=(2, 10), m=6, n=10, k=2
[[Node: MatMul = MatMul[T=DT_FLOAT, transpose_a=false, transpose_b=false, _device="/job:localhost/replica:0/task:0/device:GPU:0"](_arg_Placeholder_0_0/_1, Variable/read)]]

파일을 수정한 내용은 없으신지, 파이썬 3.5 이상, 텐서플로 1.2 이상을 PC 환경에 맞게 잘 설치하셨는지 확인 해주세요.

네, GPU 를 사용 하니까 이런 에러가 나오네요.
session 생성 시 아래 option 을 추가해서 해결 했습니다.
감사합니다.

config = tf.ConfigProto()
config.gpu_options.allow_growth = True
sess = tf.Session(config=config)