AngusG / tensorflow-xnor-bnn

BinaryNets in TensorFlow with XNOR GEMM op
Apache License 2.0
154 stars 39 forks source link

bn after xnor not working #2

Open uuleon opened 6 years ago

uuleon commented 6 years ago

error: ValueError: ('Input has undefined rank:', TensorShape(None))

uuleon commented 6 years ago

update: reshape the tensor before BN seems working

AngusG commented 6 years ago

Do you mind providing some more details about the error you encountered and how it can be reproduced? How did you reshape the tensor to resolve the issue?

uuleon commented 6 years ago

fc2 = tf.nn.dropout(xnor_gemm(fc1, Wb_2), self.keep_prob) fc2 = tf.reshape(fc2, [-1, self.n_hidden]) That is what i do to make it work.

And i meet another problem, when matrix m n multiply n k, the xnor gemm operator cannot work if m != n != k. And i fixed it by myself.

uuleon commented 6 years ago

I have realized that some detail of your code match this paper, http://ai2-website.s3.amazonaws.com/publications/XNOR-Net.pdf. Am i right?

Zoro95 commented 6 years ago

@uuleon Do you mind telling me how to fix the problem occurred when matrix m n multiply n k ?