ehw-fit / tf-approximate

Approximate layers - TensorFlow extension
MIT License
26 stars 10 forks source link

[tf2]Does kernel size=(1, 1) work ? #12

Closed haihai-self closed 2 years ago

haihai-self commented 3 years ago

Hi, my name is hai-hai Thank you for your opening source very much. I tried to work on resnet54, but found that aproximate result is greatly affect when the kernel=(1 ,1), such as FakeApproxConv2D(kernel_size=(1,1)), I want to know whether the convolution behavior is defined when kernel=(1, 1). Look forward to your answer and best wish

mrazekv commented 3 years ago

Hi hai-hai, thank you for your interest in this library.

Part with kernel_size=(1. 1) may have a bug in the implementation. You can try to comment on these lines tf2/src/approx_nn_conv_ops.cpp lines 538 - 580

This part of the code speeds up the evaluation where full GEMM is not needed. However, there may be some bug.

Did it help? Vojta

mhsamavatian commented 3 years ago

Yes, that part of the code is buggy. Without that it works.