isikdogan / deepwatermap

a deep model that segments water on multispectral images
134 stars 50 forks source link

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

Open chaijian2019 opened 2 years ago

chaijian2019 commented 2 years ago

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 commented 2 years ago

image

jsta commented 1 year ago

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 commented 1 year ago

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