cultionet icon indicating copy to clipboard operation
cultionet copied to clipboard

(bug) Prediction with window size slightly too small

Open MatthewPierson90 opened this issue 2 years ago • 4 comments

I just encountered an error doing a prediction on a test image.

It seems to be a result of the test image shape being just barley bigger than a multiple of the window size. In my case the raster data shape was (201, 200) and I was using a window size of 100. The error is occurring in SingleSensorNetwork and I believe it is occurring because the last piece shape is (100,1).

This results in a call to range(0, negative_value) and I suspect cython might be taking the largest int value it can and looping over that. the offending code is in n _build_network.pyx on line 344

I will investigate further.

MatthewPierson90 avatar Jun 17 '22 18:06 MatthewPierson90

Well, at one point it resulted in a memory leak (which is why I thought it might be looping over large values) but I can't recreate that behavior, so now it is just exiting.

MatthewPierson90 avatar Jun 17 '22 19:06 MatthewPierson90

Good find -- we typically enforce the image dimensions in the generation of the time series data. Are you saying here that your input image has a dimension of (201 x 200)?

jgrss avatar Jun 18 '22 16:06 jgrss

For training the model I have also been enforcing dimensions (always 100x100). I did notice that your prediction function will make mosaics from larger data by iterating through the image, and so I had been playing with that to set up an inference script. I can absolutely enforce dimensions there too, that will be easy, this was just something I ran into.

On another note, the very right column and very bottom row of my predictions are often weird, have you run into this at all? I suspect I have everything off by a pixel somewhere in my code, but I can't find it. I can open a different issue for this if desired.

MatthewPierson90 avatar Jun 19 '22 14:06 MatthewPierson90