---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-17-8db7cb61c5c4> in <module>()
----> 1 feat = RNN(x, weights, biases)
2
3 # TODO: rewrite this as tf layer
4 pred = svm_layer(feat,y)
<ipython-input-10-2186d473735d> in RNN(x, weights, biases)
12
13 # Get lstm cell output
---> 14 outputs, states = rnn.static_rnn(lstm_cell, x, dtype=tf.float32)
15
16 # Linear activation, using rnn inner loop last output
/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/rnn.pyc in static_rnn(cell, inputs, initial_state, dtype, sequence_length, scope)
1210 state_size=cell.state_size)
1211 else:
-> 1212 (output, state) = call_cell()
1213
1214 outputs.append(output)
/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/rnn.pyc in <lambda>()
1197 varscope.reuse_variables()
1198 # pylint: disable=cell-var-from-loop
-> 1199 call_cell = lambda: cell(input_, state)
1200 # pylint: enable=cell-var-from-loop
1201 if sequence_length is not None:
/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/rnn_cell_impl.pyc in __call__(self, inputs, state, scope)
178 with vs.variable_scope(vs.get_variable_scope(),
179 custom_getter=self._rnn_get_variable):
--> 180 return super(RNNCell, self).__call__(inputs, state)
181
182 def _rnn_get_variable(self, getter, *args, **kwargs):
/usr/local/lib/python2.7/dist-packages/tensorflow/python/layers/base.pyc in __call__(self, inputs, *args, **kwargs)
439 # Check input assumptions set after layer building, e.g. input shape.
440 self._assert_input_compatibility(inputs)
--> 441 outputs = self.call(inputs, *args, **kwargs)
442
443 # Apply activity regularization.
/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/rnn_cell_impl.pyc in call(self, inputs, state)
381 c, h = array_ops.split(value=state, num_or_size_splits=2, axis=1)
382
--> 383 concat = _linear([inputs, h], 4 * self._num_units, True)
384
385 # i = input_gate, j = new_input, f = forget_gate, o = output_gate
/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/rnn_cell_impl.pyc in _linear(args, output_size, bias, bias_initializer, kernel_initializer)
1015 _WEIGHTS_VARIABLE_NAME, [total_arg_size, output_size],
1016 dtype=dtype,
-> 1017 initializer=kernel_initializer)
1018 if len(args) == 1:
1019 res = math_ops.matmul(args[0], weights)
/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.pyc in get_variable(name, shape, dtype, initializer, regularizer, trainable, collections, caching_device, partitioner, validate_shape, use_resource, custom_getter)
1063 collections=collections, caching_device=caching_device,
1064 partitioner=partitioner, validate_shape=validate_shape,
-> 1065 use_resource=use_resource, custom_getter=custom_getter)
1066 get_variable_or_local_docstring = (
1067 """%s
/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.pyc in get_variable(self, var_store, name, shape, dtype, initializer, regularizer, reuse, trainable, collections, caching_device, partitioner, validate_shape, use_resource, custom_getter)
960 collections=collections, caching_device=caching_device,
961 partitioner=partitioner, validate_shape=validate_shape,
--> 962 use_resource=use_resource, custom_getter=custom_getter)
963
964 def _get_partitioned_variable(self,
/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.pyc in get_variable(self, name, shape, dtype, initializer, regularizer, reuse, trainable, collections, caching_device, partitioner, validate_shape, use_resource, custom_getter)
358 reuse=reuse, trainable=trainable, collections=collections,
359 caching_device=caching_device, partitioner=partitioner,
--> 360 validate_shape=validate_shape, use_resource=use_resource)
361 else:
362 return _true_getter(
/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/rnn_cell_impl.pyc in _rnn_get_variable(self, getter, *args, **kwargs)
181
182 def _rnn_get_variable(self, getter, *args, **kwargs):
--> 183 variable = getter(*args, **kwargs)
184 trainable = (variable in tf_variables.trainable_variables() or
185 (isinstance(variable, tf_variables.PartitionedVariable) and
/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.pyc in _true_getter(name, shape, dtype, initializer, regularizer, reuse, trainable, collections, caching_device, partitioner, validate_shape, use_resource)
350 trainable=trainable, collections=collections,
351 caching_device=caching_device, validate_shape=validate_shape,
--> 352 use_resource=use_resource)
353
354 if custom_getter is not None:
/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variable_scope.pyc in _get_single_variable(self, name, shape, dtype, initializer, regularizer, partition_info, reuse, trainable, collections, caching_device, validate_shape, use_resource)
662 " Did you mean to set reuse=True in VarScope? "
663 "Originally defined at:\n\n%s" % (
--> 664 name, "".join(traceback.format_list(tb))))
665 found_var = self._vars[name]
666 if not shape.is_compatible_with(found_var.get_shape()):
ValueError: Variable rnn/basic_lstm_cell/kernel already exists, disallowed. Did you mean to set reuse=True in VarScope? Originally defined at:
File "<ipython-input-10-2186d473735d>", line 14, in RNN
outputs, states = rnn.static_rnn(lstm_cell, x, dtype=tf.float32)
File "<ipython-input-12-6e99fc5c6c72>", line 1, in <module>
feat = RNN(x, weights, biases)
File "/usr/local/lib/python2.7/dist-packages/IPython/core/interactiveshell.py", line 2882, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)