Code Monkey home page Code Monkey logo

Comments (3)

MarvinTeichmann avatar MarvinTeichmann commented on July 17, 2024

This sounds strange. My tensorflow 1.2 Version has the attribute tf.GraphKeys.REGULARIZATION_LOSSES. (See output below).

As a workaround you can replace tf.GraphKeys.REGULARIZATION_LOSSES by any string. The string 'regularization_losses' would be an option. tf.GraphKeys.REGULARIZATION_LOSSES appears 10 times in the code (see second output).

Python 2.7.12 (default, Nov 19 2016, 06:48:10) 
Type "copyright", "credits" or "license" for more information.

IPython 5.4.1 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import tensorflow as tf
In [2]: tf.GraphKeys.REGULARIZATION_LOSSES
Out[2]: 'regularization_losses'
In [3]: tf.__version__
Out[3]: '1.2.0'
In [4]: 
>> ack tf.GraphKeys.REGULARIZATION_LOSSES  
tensorflow-fcn/fcn32_vgg.py
259:            tf.add_to_collection(tf.GraphKeys.REGULARIZATION_LOSSES,
282:            tf.add_to_collection(tf.GraphKeys.REGULARIZATION_LOSSES,
362:            tf.add_to_collection(tf.GraphKeys.REGULARIZATION_LOSSES,

tensorflow-fcn/fcn8_vgg.py
290:            tf.add_to_collection(tf.GraphKeys.REGULARIZATION_LOSSES,
316:            tf.add_to_collection(tf.GraphKeys.REGULARIZATION_LOSSES,
394:        collection_name = tf.GraphKeys.REGULARIZATION_LOSSES
404:            collection_name = tf.GraphKeys.REGULARIZATION_LOSSES

tensorflow-fcn/fcn16_vgg.py
274:            tf.add_to_collection(tf.GraphKeys.REGULARIZATION_LOSSES,
297:            tf.add_to_collection(tf.GraphKeys.REGULARIZATION_LOSSES,
377:            tf.add_to_collection(tf.GraphKeys.REGULARIZATION_LOSSES,

from tensorflow-fcn.

FLSD-LEO avatar FLSD-LEO commented on July 17, 2024

Thanks for your reply!
I have solved the problem by reinstalling.
But I get another error like this.

2017-07-21 20:08:07.805898: W tensorflow/core/framework/op_kernel.cc:1158] Resource exhausted: OOM when allocating tensor with shape[1,4096,13,15]
Traceback (most recent call last):
File "test_fcn32_vgg.py", line 33, in
down, up = sess.run(tensors, feed_dict=feed_dict)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 789, in run
run_metadata_ptr)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 997, in _run
feed_dict_string, options, run_metadata)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1132, in _do_run
target_list, options, run_metadata)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1152, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.ResourceExhaustedError: OOM when allocating tensor with shape[1,4096,13,15]
[[Node: content_vgg/fc6/Conv2D = Conv2D[T=DT_FLOAT, data_format="NHWC", padding="SAME", strides=[1, 1, 1, 1], use_cudnn_on_gpu=true, _device="/job:localhost/replica:0/task:0/gpu:0"](content_vgg/Print_4/_39, fc6/weights/read)]]

Caused by op u'content_vgg/fc6/Conv2D', defined at:
File "test_fcn32_vgg.py", line 24, in
vgg_fcn.build(batch_images, debug=True)
File "/home/sheldon/tensorflow-fcn-master/fcn32_vgg.py", line 97, in build
self.fc6 = self._fc_layer(self.pool5, "fc6")
File "/home/sheldon/tensorflow-fcn-master/fcn32_vgg.py", line 159, in _fc_layer
conv = tf.nn.conv2d(bottom, filt, [1, 1, 1, 1], padding='SAME')
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_nn_ops.py", line 399, in conv2d
data_format=data_format, name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 767, in apply_op
op_def=op_def)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2506, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1269, in init
self._traceback = _extract_stack()

ResourceExhaustedError (see above for traceback): OOM when allocating tensor with shape[1,4096,13,15]
[[Node: content_vgg/fc6/Conv2D = Conv2D[T=DT_FLOAT, data_format="NHWC", padding="SAME", strides=[1, 1, 1, 1], use_cudnn_on_gpu=true, _device="/job:localhost/replica:0/task:0/gpu:0"](content_vgg/Print_4/_39, fc6/weights/read)]]

It seems like an out of memory error. I am a new to tensorflow. How could I solve it?
By the way, tensors = [vgg_fcn.pred, vgg_fcn.pred_up] this is mean to do what?

from tensorflow-fcn.

MarvinTeichmann avatar MarvinTeichmann commented on July 17, 2024

It seems like an out of memory error. I am a new to tensorflow. How could I solve it?

Use a GPU with more Memory. Or reduce batch size or reduce size or input image or do computation on cpu.

from tensorflow-fcn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.