deepwatermap icon indicating copy to clipboard operation
deepwatermap copied to clipboard

Input 0 is incompatible with layer model: expected shape=(None, None, None, 6), found shape=(None, 32, 4992, 3334)

Open chaijian2019 opened this issue 3 years ago • 4 comments

hi bro,i run the eg is fine,but it got wrong when i run my file in tif,it said “Input 0 is incompatible with layer model: expected shape=(None, None, None, 6), found shape=(None, 32, 4992, 3334)”

chaijian2019 avatar Aug 03 '22 15:08 chaijian2019

image

chaijian2019 avatar Aug 03 '22 15:08 chaijian2019

deepwatermap expects a 6-layer sequence, per the README:

B2: Blue
B3: Green
B4: Red
B5: Near Infrared (NIR)
B6: Shortwave Infrared 1 (SWIR1)
B7: Shortwave Infrared 2 (SWIR2)

It appears your data is a 32 layers? The README says you may need to modify the inference script if your data is not of the same dimensions as Landsat etc.

"The inference script we provide gets its input from a 6-band TIFF file. You can modify the script to feed the model a matrix of MxNx6 dimensions in any form."

jsta avatar Nov 04 '22 02:11 jsta

For me, I added some lines after https://github.com/isikdogan/deepwatermap/blob/master/inference.py#L31 to reshape the input.

jsta avatar Nov 04 '22 14:11 jsta