4,446
社区成员
发帖
与我相关
我的任务
分享
ValueError Traceback (most recent call last)
<ipython-input-13-8ae8e5b3e751> in <module>()
23 BATCH_SIZE,
24 CAPACITY)
---> 25 train_logits = model.inference(train_batch, BATCH_SIZE, N_CLASSES)
26 train_loss = model.losses(train_logits, train_label_batch)
27 train_op = model.trainning(train_loss, learning_rate)
E:\cat and dog\model.py in inference(images, batch_size, n_classes)
8 shape=[3, 3, 3, 16],
9 dtype=tf.float32,
---> 10 initializer=tf.truncated_normal_initializer(stddev=0.1, dtype=tf.float32))
11 biases = tf.get_variable('biases',
12 shape=[16],
D:\Anaconda\lib\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)
1022 collections=collections, caching_device=caching_device,
1023 partitioner=partitioner, validate_shape=validate_shape,
-> 1024 custom_getter=custom_getter)
1025
1026
D:\Anaconda\lib\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)
848 collections=collections, caching_device=caching_device,
849 partitioner=partitioner, validate_shape=validate_shape,
--> 850 custom_getter=custom_getter)
851
852 def _get_partitioned_variable(self,
D:\Anaconda\lib\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)
344 reuse=reuse, trainable=trainable, collections=collections,
345 caching_device=caching_device, partitioner=partitioner,
--> 346 validate_shape=validate_shape)
347
348 def _get_partitioned_variable(
D:\Anaconda\lib\site-packages\tensorflow\python\ops\variable_scope.py in _true_getter(name, shape, dtype, initializer, regularizer, reuse, trainable, collections, caching_device, partitioner, validate_shape)
329 initializer=initializer, regularizer=regularizer, reuse=reuse,
330 trainable=trainable, collections=collections,
--> 331 caching_device=caching_device, validate_shape=validate_shape)
332
333 if custom_getter is not None:
D:\Anaconda\lib\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)
630 " Did you mean to set reuse=True in VarScope? "
631 "Originally defined at:\n\n%s" % (
--> 632 name, "".join(traceback.format_list(tb))))
633 found_var = self._vars[name]
634 if not shape.is_compatible_with(found_var.get_shape()):
ValueError: Variable conv1/weights already exists, disallowed. Did you mean to set reuse=True in VarScope? Originally defined at:
File "D:\Anaconda\lib\site-packages\tensorflow\python\framework\ops.py", line 1128, in __init__
self._traceback = _extract_stack()
File "D:\Anaconda\lib\site-packages\tensorflow\python\framework\ops.py", line 2240, in create_op
original_op=self._default_original_op, op_def=op_def)
File "D:\Anaconda\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 759, in apply_op
op_def=op_def)