Open zxqcreations opened 6 years ago
same error happens to me. do you know how to fix it?
I fixed the error in this way: change lines 87,88 in ./lib/nets/vgg16.py fc6_conv = tf.get_variable("fc6_conv", [7, 7, 512, 4096], trainable=False) fc7_conv = tf.get_variable("fc7_conv", [1, 1, 4096, 4096], trainable=False) to fc6_conv = tf.get_variable("fc6_conv", [7 7 512, 4096], trainable=False) fc7_conv = tf.get_variable("fc7_conv", [ 4096, 4096], trainable=False)
Hi, I've tried to build my own vgg16 with my code gennet which is used to generate CNNs. By following vgg's paper, I generated a vgg16 model by myself (use testgen.py to generate a vgg16.ckpt). But when I tried to apply it to
train_faster_rcnn.sh
, I met this issue:InvalidArgumentError (see above for traceback): Assign requires shapes of both tensors to match. lhs shape= [1,1,4096,4096] rhs shape= [4096,4096]
[[Node: Fix_VGG16/save/Assign_2 = Assign[T=DT_FLOAT, _class=["loc:@Fix_VGG16/fc7_conv"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](Fix_VGG16/fc7_conv, Fix_VGG16/save/RestoreV2:2)]]
I didn't edit any code gitted from this repository, and executed
./experiments/scripts/train_faster_rcnn.sh 0 pascal_voc vgg16
.When I execute
inspect_checkpoint.py
provided by tensorflow to inspect differences between your model and mine, I got:Here 'your model' is vgg16.ckpt from google drive while mine is generated by gennet.
there are several difference from fc6 to fc8, but I don't know how to fix it. I'd like to ask you why the shape of fc layers are different or am I wrong? emm. If you are too busy to review this difference, please ignore it.
But I know my vgg16 is not working, waiting for your kindly review.