superpixPool
superpixPool copied to clipboard
Gradient check fails??
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?
I think you should use the "double" type instead of float for your inputs and network. @Mathijssch do you confirm?
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.