CNES / decloud

Apache License 2.0
40 stars 4 forks source link

Default tile size of 256 with crga_processor not working #2

Closed alexdownforce closed 2 years ago

alexdownforce commented 2 years ago

Hello,

I am running having trouble running inference with the crga_processor using the default tile size (ts) of 256. Reducing the tile size to 128 solves this issue. The problem seems to be with source #6 (DEM).

processor = crga_processor(il_s1after, il_s1before, il_s1, il_s2after, il_s2before, in_s2, dem, crga_savedmodel,
                    output=output_crga, output_20m=None, ts=256, pad=64,
                    with_20m_bands=False, maxgap=144, with_intermediate=False)

Error:

Writing /opt/working/output/CRGA_S2A_MSIL2A_20220205T111241_N0400_R137_T31UCT_20220205T143058.tif?&streaming:type=tiled&streaming:sizemode=height&streaming:sizevalue=256&gdal:co:COMPRESS=DEFLATE&gdal:co:TILED=YES...: 0% [                                                  ]Traceback (most recent call last):
  File "predict.py", line 45, in <module>
    processor = crga_processor(il_s1after, il_s1before, il_s1, il_s2after, il_s2before, in_s2, dem, crga_savedmodel,
  File "/opt/working/decloud/production/crga_processor.py", line 181, in crga_processor
    processed_10m.write(out=output, filename_extension=filename_extension)
  File "/usr/local/lib/python3.8/dist-packages/pyotb/core.py", line 99, in write
    self.app.ExecuteAndWriteOutput()
  File "/opt/otbtf/lib/otb/python/otbApplication.py", line 2321, in ExecuteAndWriteOutput
    return _otbApplication.Application_ExecuteAndWriteOutput(self)
RuntimeError: Exception thrown in otbApplication Application_ExecuteAndWriteOutput: /src/otb/otb/Modules/Remote/otbtf/include/otbTensorflowMultisourceModelFilter.hxx:349:
itk::ERROR: TensorflowMultisourceModelFilter(0x3e44640): The input requested region of source #6 is not consistent (dim 0).Please check RF, EF, SF vs physical spacing of your image!
Receptive field: 192
Expression field: 256
Scale factor: 1
Reference image spacing: 10
Image 6 spacing: 10
otbuser@f6a7ab15cd19:/opt/working$ 
remicres commented 2 years ago

Hi @alexdownforce , Thanks for the feedback. Could you copy/paste the log before the problem happen? The full log from the start would help us a lot. For now we are unable to reproduce the bug. Also, can you confirm that the DEM spacingx/y is 20m ? Many thanks

alexdownforce commented 2 years ago

Thanks for the response. I had the DEM at 10m which was causing the issue. I have changed the x/y spacing to 20m and it is working as expected.