sitzikbs / netVLAD

netVLAD implementation in TensorFlow
67 stars 21 forks source link

shape problem #1

Closed zyfsa closed 5 years ago

zyfsa commented 6 years ago

please, you test this code? when I apply this code in my project, (tensorflow 1.3) I ,get this issue?

Shapes must be equal rank, but are 2 and 1 for 'siamese/opt_vlad/MatMul' (op: 'BatchMatMul') with input shapes: [5,8,8,512], [5,8,1] in Wx_b = tf.matmul(inputs, wk) + b[k] this line. can you have some solution? thank you very much!

sitzikbs commented 6 years ago

yes, so it says that you have a dimension problem. Your input or w are not in the right sizes. did you make sure that the input is a 4-D tensor with dimensions BxHxWxC?

2017-11-27 6:17 GMT+02:00 zyfsa notifications@github.com:

please, you test this code? when I apply this code in my project, (tensorflow 1.3) I ,get this issue?

Shapes must be equal rank, but are 2 and 1 for 'siamese/opt_vlad/MatMul' (op: 'BatchMatMul') with input shapes: [5,8,8,512], [5,8,1] in Wx_b = tf.matmul(inputs, wk) + b[k] this line. can you have some solution? thank you very much!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sitzikbs/netVLAD/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/ANJ7e9qvhxQp7A_gJplrz3aYlen9VTJ5ks5s6jfDgaJpZM4QrGmo .

-- Itzik Ben-Shabat PhD Student CAD Lab Mechanical Engineering Department Technion, Israel Institute of Technology www.itzikbs.com

zyfsa commented 6 years ago

hi,from my error, you can see my input is [5,8,8,512],.so I.m fused. In addition, I see this orignal code by matconvnet, I think your code has some difference with its. can you figure it out? thanks

sitzikbs commented 6 years ago

Ok, I am having some difficulty finding my original testing code ( I dont know why I didnt post it). If you can send me your code I can try and find the problem. I guess you are working on images, I was working on a different domain and perhaps that is the issue. But before you do, try and test it in tensorflow 1.0 I havnt checked but maybe matmul changed ?

zyfsa commented 6 years ago

Thanks, I check it again. when I can't solve this problem, i will sent my code for you. thank you.

sitzikbs commented 6 years ago

So I think the problem is actually in my documentation and not the code (and even got me confused). The VLAD pooling pools the features so its dimensions should be Batch_sizeXNumber_of_featuresXnumber_element_in_each_feature. So if your features are the output of a CNN, you would probably need to flatten them. Let me know if it works for you and I will update the documentation.

2017-11-27 14:38 GMT+02:00 zyfsa notifications@github.com:

hello,I give you a message to sitzikbs@campus.technion.ac.il thank you

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/sitzikbs/netVLAD/issues/1#issuecomment-347169900, or mute the thread https://github.com/notifications/unsubscribe-auth/ANJ7exrwFWtPCKaW8fmPWftPOfis2uQ9ks5s6q1DgaJpZM4QrGmo .

-- Itzik Ben-Shabat PhD Student CAD Lab Mechanical Engineering Department Technion, Israel Institute of Technology www.itzikbs.com

DavideCatto commented 6 years ago

I think you must resize your input tensor of BxHxWxC into BxNxC where N is HxW. It seem working.

sitzikbs commented 5 years ago

Closing due to lack of activity.