Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ResourceExhaustedError (see above for traceback): OOM when allocating tensor with shape[18432,3072] #48

Open
itsss opened this issue Jun 9, 2018 · 2 comments

Comments

@itsss
Copy link

itsss commented Jun 9, 2018

hdf5 is not supported on this machine (please install/reinstall h5py for optimal experience)
Scipy not supported!
[+] Building CNN
WARNING:tensorflow:From /usr/local/lib/python2.7/dist-packages/tflearn/initializations.py:119: init (from tensorflow.python.ops.init_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.initializers.variance_scaling instead with distribution=uniform to get equivalent behavior.
WARNING:tensorflow:From /usr/local/lib/python2.7/dist-packages/tflearn/objectives.py:66: calling reduce_sum (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version.
Instructions for updating:
keep_dims is deprecated, use keepdims instead
2018-06-09 09:37:52.181904: W tensorflow/core/framework/allocator.cc:101] Allocation of 226492416 exceeds 10% of system memory.
2018-06-09 09:37:53.283209: W tensorflow/core/framework/allocator.cc:101] Allocation of 226492416 exceeds 10% of system memory.
2018-06-09 09:37:53.642209: W tensorflow/core/framework/allocator.cc:101] Allocation of 226492416 exceeds 10% of system memory.
2018-06-09 09:37:54.366458: W tensorflow/core/framework/allocator.cc:101] Allocation of 226492416 exceeds 10% of system memory.
2018-06-09 09:37:54.729838: W tensorflow/core/framework/allocator.cc:101] Allocation of 226492416 exceeds 10% of system memory.
2018-06-09 09:37:54.736810: W tensorflow/core/framework/allocator.cc:101] Allocation of 226492416 exceeds 10% of system memory.
2018-06-09 09:38:08.227552: W tensorflow/core/framework/allocator.cc:101] Allocation of 226492416 exceeds 10% of system memory.
2018-06-09 09:38:08.369418: W tensorflow/core/framework/op_kernel.cc:1318] OP_REQUIRES failed at assign_op.h:112 : Resource exhausted: OOM when allocating tensor with shape[18432,3072] and type float on /job:localhost/replica:0/task:0/device:CPU:0 by allocator cpu
Traceback (most recent call last):
File "emotion_recognition.py", line 97, in
import poc
File "/home/pi/EmotionReceiptMusic/poc.py", line 66, in
network.build_network()
File "/home/pi/EmotionReceiptMusic/emotion_recognition.py", line 39, in build_network
tensorboard_verbose = 2
File "/usr/local/lib/python2.7/dist-packages/tflearn/models/dnn.py", line 65, in init
best_val_accuracy=best_val_accuracy)
File "/usr/local/lib/python2.7/dist-packages/tflearn/helpers/trainer.py", line 170, in init
self.session.run(init)
File "/home/pi/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 900, in run
run_metadata_ptr)
File "/home/pi/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1135, in _run
feed_dict_tensor, options, run_metadata)
File "/home/pi/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1316, in _do_run
run_metadata)
File "/home/pi/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1335, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.ResourceExhaustedError: OOM when allocating tensor with shape[18432,3072] and type float on /job:localhost/replica:0/task:0/device:CPU:0 by allocator cpu
[[Node: FullyConnected/W/Assign = Assign[T=DT_FLOAT, use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](FullyConnected/W, FullyConnected/W/Initializer/truncated_normal)]]
Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info.

Caused by op u'FullyConnected/W/Assign', defined at:
File "emotion_recognition.py", line 97, in
import poc
File "/home/pi/EmotionReceiptMusic/poc.py", line 66, in
network.build_network()
File "/home/pi/EmotionReceiptMusic/emotion_recognition.py", line 30, in build_network
self.network = fully_connected(self.network, 3072, activation = 'relu')
File "/usr/local/lib/python2.7/dist-packages/tflearn/layers/core.py", line 157, in fully_connected
restore=restore)
File "/home/pi/.local/lib/python2.7/site-packages/tensorflow/contrib/framework/python/ops/arg_scope.py", line 183, in func_with_args
return func(*args, **current_args)
File "/usr/local/lib/python2.7/dist-packages/tflearn/variables.py", line 65, in variable
validate_shape=validate_shape)
File "/home/pi/.local/lib/python2.7/site-packages/tensorflow/python/ops/variable_scope.py", line 1317, in get_variable
constraint=constraint)
File "/home/pi/.local/lib/python2.7/site-packages/tensorflow/python/ops/variable_scope.py", line 1079, in get_variable
constraint=constraint)
File "/home/pi/.local/lib/python2.7/site-packages/tensorflow/python/ops/variable_scope.py", line 425, in get_variable
constraint=constraint)
File "/home/pi/.local/lib/python2.7/site-packages/tensorflow/python/ops/variable_scope.py", line 394, in _true_getter
use_resource=use_resource, constraint=constraint)
File "/home/pi/.local/lib/python2.7/site-packages/tensorflow/python/ops/variable_scope.py", line 786, in _get_single_variable
use_resource=use_resource)
File "/home/pi/.local/lib/python2.7/site-packages/tensorflow/python/ops/variable_scope.py", line 2220, in variable
use_resource=use_resource)
File "/home/pi/.local/lib/python2.7/site-packages/tensorflow/python/ops/variable_scope.py", line 2210, in
previous_getter = lambda **kwargs: default_variable_creator(None, **kwargs)
File "/home/pi/.local/lib/python2.7/site-packages/tensorflow/python/ops/variable_scope.py", line 2193, in default_variable_creator
constraint=constraint)
File "/home/pi/.local/lib/python2.7/site-packages/tensorflow/python/ops/variables.py", line 235, in init
constraint=constraint)
File "/home/pi/.local/lib/python2.7/site-packages/tensorflow/python/ops/variables.py", line 387, in _init_from_args
validate_shape=validate_shape).op
File "/home/pi/.local/lib/python2.7/site-packages/tensorflow/python/ops/state_ops.py", line 283, in assign
validate_shape=validate_shape)
File "/home/pi/.local/lib/python2.7/site-packages/tensorflow/python/ops/gen_state_ops.py", line 60, in assign
use_locking=use_locking, name=name)
File "/home/pi/.local/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/home/pi/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 3392, in create_op
op_def=op_def)
File "/home/pi/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1718, in init
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access

ResourceExhaustedError (see above for traceback): OOM when allocating tensor with shape[18432,3072] and type float on /job:localhost/replica:0/task:0/device:CPU:0 by allocator cpu
[[Node: FullyConnected/W/Assign = Assign[T=DT_FLOAT, use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](FullyConnected/W, FullyConnected/W/Initializer/truncated_normal)]]
Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info.

===============================================================
What should i do? Please help me...

@gmsdelmundo
Copy link

It looks like your CPU does not have the capacity to allocate the tensor. You might have to reduce the tensor sizes in your network. For example, you could try increasing your strides, or decreasing the number of units in your fully connected layer.

@FanGeV5
Copy link

FanGeV5 commented Mar 6, 2019

default
I try to use tensorflow-gpu to calculate a DQN model,but there are errors ?please help me.Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants