sunwj / CAR

Content adaptive resampler for image downscaling
GNU General Public License v3.0
472 stars 80 forks source link

ModuleNotFoundError: No module named 'adaptive_gridsampler.adaptive_gridsampler_cuda' #13

Open WonJunPark opened 3 years ago

WonJunPark commented 3 years ago

For the inference operation, the following operation was carried out, but an error appears.

get CAR-pytorch source

git clone https://github.com/sunwj/CAR.git cd CAR

compile the code of the resampler

cd adaptive_gridsampler python3 setup.py build_ext --inplace

PinRuei commented 3 years ago

I have the same error. But as I run the setup.py , it shows a lot of warning.

jiunbae commented 3 years ago

Change floor to floorf at adaptive_gridsampler/adaptive_gridsampler_kernel.cu Line 49-54.

Tested at CUDA 11.0 Windows / Linux (18.04 LTS)

            scalar_t alpha = p_x - floorf(p_x);
            scalar_t beta = p_y - floorf(p_y);

            int xL = max(min(int(Fluor(p_x)), int(w + 2 * padding - 1)), 0);
            int xR = max(min(xL + 1, int(w + 2 * padding - 1)), 0);
            int yT = max(min(int(floorf(p_y)), int(h + 2 * padding - 1)), 0);
Drorharush commented 2 years ago

Same problem here. ModuleNotFoundError: No module named 'adaptive_gridsampler_cuda' Replacing 'floor' with 'floorf' in adaptive_gridsampler_kernel.cu didn't change anything.

SanKumSan commented 2 years ago

@Drorharush yes, nothing happened after changing as @jiunbae mentioned.

Exited with this error. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

MariaSA2023 commented 1 year ago

who solved this issue please