superpixPool icon indicating copy to clipboard operation
superpixPool copied to clipboard

Gradient check fails??

Open Miracle2333 opened this issue 7 years ago • 2 comments
trafficstars

I am able to build setup.py and run test_GPUpool without errors. But gradient check results are always wrong. And I got the following warnings: UserWarning: At least one of the inputs that requires gradient is not of double precision floating point. This check will likely fail if all the inputs are not of double precision floating point. 'At least one of the inputs that requires gradient ' I check that the data type of X is float while that of spx is int. Should spx be converted to float to pass the gradient check?

Miracle2333 avatar Nov 16 '18 21:11 Miracle2333

I think you should use the "double" type instead of float for your inputs and network. @Mathijssch do you confirm?

bermanmaxim avatar Jan 04 '19 13:01 bermanmaxim

If I recall correctly, the kernel is templated and should be able to handle both floats and doubles as X. spx should certainly contain ints, although it get converted automatically to ints if you would supply it as floats. The current test_GPUpool (which indeed uses floats for the test image) did use to pass previously, so I suspect it might have to do with the newer pytorch version.

Mathijssch avatar Jan 04 '19 16:01 Mathijssch