Closed abc8350712 closed 7 years ago
The error implies that you have a variable defined in your model but without being used when running the train_op. Try:
def basenet(inputs):
logit, endpoints =resnet_50(inputs)
endpoints['conv4_3'] = endpoints['vgg/resnet_50/block2/unit_2']
endpoints['fc7'] = logit # Maybe relu should be added on the logit: relu(logit)
return endpoints['fc7'], endpoints
@dengdan Amazing!It can work!Thank you very much!!
When I try to change the VGG net to Resnet,it doesn't work.
I mainly change the vgg.py file like
However it dosen't work but come out:
Traceback (most recent call last): File "/home/moon/seglink-master/train_seglink.py", line 276, in
tf.app.run()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "/home/moon/seglink-master/train_seglink.py", line 271, in main
train_op = create_clones(batch_queue)
File "/home/moon/seglink-master/train_seglink.py", line 220, in create_clones
averaged_gradients = sum_gradients(gradients)
File "/home/moon/seglink-master/train_seglink.py", line 164, in sum_gradients
grad = tf.add_n(grads, name = v.op.name + '_summed_gradients')
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/math_ops.py", line 1918, in add_n
raise ValueError("inputs must be a list of at least one Tensor with the "
ValueError: inputs must be a list of at least one Tensor with the same dtype and shape
My coarse renset implemention is as follow:
Can you help me figure it out? Is there any example for changing basenet? Thank you! @dengdan