---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-7-55f20c8c5070> in <module>()
22 batch_X, batch_y = datasets.train.next_batch(batch_size)
23 # Run optimization op (backprop)
---> 24 summary, _ = sess.run([merged, rcnn.train],
25 feed_dict={X: batch_X, y: batch_y,
26 keep_prob: dropout})
/home/jovyan/work/define_scope.py in decorator(self)
58 if not hasattr(self, attribute):
59 with tf.variable_scope(name, *args, **kwargs): # pylint: disable=undefined-variable
---> 60 setattr(self, attribute, function(self))
61 return getattr(self, attribute)
62
/home/jovyan/work/rcnn.py in train(self)
163 with tf.name_scope('train'):
164 optimizer = tf.train.AdamOptimizer(learning_rate=self.learning_rate)
--> 165 minimize = optimizer.minimize(self.loss)
166 return minimize
167
/home/jovyan/work/define_scope.py in decorator(self)
58 if not hasattr(self, attribute):
59 with tf.variable_scope(name, *args, **kwargs): # pylint: disable=undefined-variable
---> 60 setattr(self, attribute, function(self))
61 return getattr(self, attribute)
62
/home/jovyan/work/rcnn.py in loss(self)
173 with tf.name_scope('cross_entopy'):
174 diff = tf.nn.sparse_softmax_cross_entropy_with_logits(
--> 175 logits=self.inference, labels=self.y)
176 with tf.name_scope('total'):
177 cross_entropy = tf.reduce_mean(diff)
/home/jovyan/work/define_scope.py in decorator(self)
58 if not hasattr(self, attribute):
59 with tf.variable_scope(name, *args, **kwargs): # pylint: disable=undefined-variable
---> 60 setattr(self, attribute, function(self))
61 return getattr(self, attribute)
62
/home/jovyan/work/rcnn.py in inference(self)
127 # Convolution Layer
128 with tf.variable_scope('conv1'):
--> 129 conv1 = conv_relu(X, [1, 1, 1, 32], [32], 'conv1')
130 # conv1 = conv2d(X, params['Wc1'], params['bc1'])
131
/home/jovyan/work/rcnn.py in conv_relu(input_tensor, kernel_shape, bias_shape, layer_name, act)
110 # Create variable named "weights".
111 weights = tf.get_variable("weights", kernel_shape,
--> 112 initializer=tf.random_normal_initializer())
113 # Create variable named "biases".
114 biases = tf.get_variable("biases", bias_shape,
/opt/conda/lib/python3.5/site-packages/tensorflow/python/ops/variable_scope.py in get_variable(name, shape, dtype, initializer, regularizer, trainable, collections, caching_device, partitioner, validate_shape, custom_getter)
1020 collections=collections, caching_device=caching_device,
1021 partitioner=partitioner, validate_shape=validate_shape,
-> 1022 custom_getter=custom_getter)
1023
1024
/opt/conda/lib/python3.5/site-packages/tensorflow/python/ops/variable_scope.py in get_variable(self, var_store, name, shape, dtype, initializer, regularizer, trainable, collections, caching_device, partitioner, validate_shape, custom_getter)
847 collections=collections, caching_device=caching_device,
848 partitioner=partitioner, validate_shape=validate_shape,
--> 849 custom_getter=custom_getter)
850
851 def _get_partitioned_variable(self,
/opt/conda/lib/python3.5/site-packages/tensorflow/python/ops/variable_scope.py in get_variable(self, name, shape, dtype, initializer, regularizer, reuse, trainable, collections, caching_device, partitioner, validate_shape, custom_getter)
343 reuse=reuse, trainable=trainable, collections=collections,
344 caching_device=caching_device, partitioner=partitioner,
--> 345 validate_shape=validate_shape)
346
347 def _get_partitioned_variable(
/opt/conda/lib/python3.5/site-packages/tensorflow/python/ops/variable_scope.py in _true_getter(name, shape, dtype, initializer, regularizer, reuse, trainable, collections, caching_device, partitioner, validate_shape)
328 initializer=initializer, regularizer=regularizer, reuse=reuse,
329 trainable=trainable, collections=collections,
--> 330 caching_device=caching_device, validate_shape=validate_shape)
331
332 if custom_getter is not None:
/opt/conda/lib/python3.5/site-packages/tensorflow/python/ops/variable_scope.py in _get_single_variable(self, name, shape, dtype, initializer, regularizer, partition_info, reuse, trainable, collections, caching_device, validate_shape)
631 " Did you mean to set reuse=True in VarScope? "
632 "Originally defined at:\n\n%s" % (
--> 633 name, "".join(traceback.format_list(tb))))
634 found_var = self._vars[name]
635 if not shape.is_compatible_with(found_var.get_shape()):
ValueError: Variable train/loss/inference/conv1/weights already exists, disallowed. Did you mean to set reuse=True in VarScope? Originally defined at:
File "/home/jovyan/work/rcnn.py", line 112, in conv_relu
initializer=tf.random_normal_initializer())
File "/home/jovyan/work/rcnn.py", line 129, in inference
conv1 = conv_relu(X, [1, 1, 1, 32], [32], 'conv1')
File "/home/jovyan/work/define_scope.py", line 60, in decorator
setattr(self, attribute, function(self))