tensorflow-xnor-bnn
tensorflow-xnor-bnn copied to clipboard
Error when both --binary --xnor are set
Hi, I ran a test with both --binary and --xnor set. Here are the errors,
2018-04-26 10:34:44.400066: I tensorflow/core/common_runtime/gpu/gpu_device.cc:961] DMA: 0 2018-04-26 10:34:44.400072: I tensorflow/core/common_runtime/gpu/gpu_device.cc:971] 0: Y 2018-04-26 10:34:44.400080: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1030] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX TITAN X, pci bus id: 0000:01:00.0) Traceback (most recent call last): File "/home/ubuntu/anaconda2/envs/tf-xnor-bnn/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1139, in _do_call return fn(*args) File "/home/ubuntu/anaconda2/envs/tf-xnor-bnn/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1121, in _run_fn status, run_metadata) File "/home/ubuntu/anaconda2/envs/tf-xnor-bnn/lib/python3.6/contextlib.py", line 89, in exit next(self.gen) File "/home/ubuntu/anaconda2/envs/tf-xnor-bnn/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py", line 466, in raise_exception_on_not_ok_status pywrap_tensorflow.TF_GetCode(status)) tensorflow.python.framework.errors_impl.InvalidArgumentError: Matrix size-incompatible: In[0]: [128,512], In[1]: [512,512] [[Node: fc2_b/Gemm = Gemm[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/gpu:0"](fc1_b/Sign, fc2_b/Sign)]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "mnist_fc_bnn.py", line 154, in
Caused by op 'fc2_b/Gemm', defined at:
File "mnist_fc_bnn.py", line 86, in
InvalidArgumentError (see above for traceback): Matrix size-incompatible: In[0]: [128,512], In[1]: [512,512] [[Node: fc2_b/Gemm = Gemm[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/gpu:0"](fc1_b/Sign, fc2_b/Sign)]]
Do you have an idea how to fix it?
Thanks a lot
It's a known bug at the moment that the matrices have to be square, just haven't had time to push a fix.
thanks for you quick reply. Can you push the fix ASAP or email the fix to me at [email protected]?
It seems the mnist_conv_bnn.py works fine with a few simple changes. I asked a question in another Issue but I closed it. It is about a confirmation of what you implement in this repo. My understanding this is a binaryNet with xnor GEMM so it speeds up even on a PC. Is that right?
Thanks.