0

When tensorflow-gpu running for a while(about 2hr~), it has a MemoryError about array

Traceback (most recent call last):

  File "<ipython-input-1-680341707274>", line 1, in <module>
    runfile('D:/google_sync/google_sync/Programming Language/Tensorflow/game/game.py', wdir='D:/google_sync/google_sync/Programming Language/Tensorflow/game')

  File "C:\Users\wyp87\Anaconda3\envs\tensorflow-gpu\lib\site-packages\spyder\utils\site\sitecustomize.py", line 705, in runfile
    execfile(filename, namespace)

  File "C:\Users\wyp87\Anaconda3\envs\tensorflow-gpu\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "D:/google_sync/google_sync/Programming Language/Tensorflow/game/game.py", line 210, in <module>
    train_neural_network(input_image)

  File "D:/google_sync/google_sync/Programming Language/Tensorflow/game/game.py", line 193, in train_neural_network
    out_batch = predict_action.eval(feed_dict = {input_image : input_image_data1_batch})

  File "C:\Users\wyp87\Anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\framework\ops.py", line 680, in eval
    return _eval_using_default_session(self, feed_dict, self.graph, session)

  File "C:\Users\wyp87\Anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\framework\ops.py", line 4951, in _eval_using_default_session
    return session.run(tensors, feed_dict)

  File "C:\Users\wyp87\Anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\client\session.py", line 877, in run
    run_metadata_ptr)

  File "C:\Users\wyp87\Anaconda3\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\client\session.py", line 1069, in _run
    np_val = np.asarray(subfeed_val, dtype=subfeed_dtype)

  File "C:\Users\wyp87\Anaconda3\envs\tensorflow-gpu\lib\site-packages\numpy\core\numeric.py", line 501, in asarray
    return array(a, dtype, copy=False, order=order)

MemoryError

I try :

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

and

gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=0.4)
sess = tf.Session(config=tf.ConfigProto(gpu_options=gpu_options))

BUT, The problem still exists I don't know how to solve the error..

GPU log file:

My python file:

Computer:MSI GE62 notebook

CPU:I7-6700HQ

GPU:GTX960M

Tensorflow:1.10.0

Python:3.5.6

CUDA9.0

I still have a question When I use tensorflowGPU, it will crash when the screen recorder app is running, right?

1 Answer 1

0

if it would be your GPU-memory giving the error you would see resource exhausted, this seems to be a python error, instead of tensorflow specific. It's your memory getting filled most likely due to inefficient code. See this question.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.