Closed FLSD-LEO closed 7 years ago
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,
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
Caused by op u'content_vgg/fc6/Conv2D', defined at:
File "test_fcn32_vgg.py", line 24, in
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?
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.
Hi! I got this error.
npy file loaded Layer name: conv1_1 Layer shape: (3, 3, 3, 64) Traceback (most recent call last): 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 74, in build
self.conv1_1 = self._conv_layer(bgr, "conv1_1")
File "/home/sheldon/tensorflow-fcn-master/fcn32_vgg.py", line 135, in _conv_layer
filt = self.get_conv_filter(name)
File "/home/sheldon/tensorflow-fcn-master/fcn32_vgg.py", line 259, in get_conv_filter
tf.add_to_collection(tf.GraphKeys.REGULARIZATION_LOSSES,
AttributeError: type object 'GraphKeys' has no attribute 'REGULARIZATION_LOSSES'
python 2.7 tensorflow1.2 Could you give me some suggestions?