remicres / sr4rs

Super resolution for remote sensing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AttributeError: 'NoneType' object has no attribute 'SetParameterStringList'

badmonkeyemail opened this issue · comments

Hi,

I am trying to run the code sr.py, but I get the following error:
File "sr.py", line 83, in
infer.SetParameterStringList("source1.il", [params.input])
AttributeError: 'NoneType' object has no attribute 'SetParameterStringList'

First, I download Sentinel-2 image, and create tiff:
otbcli_BandMathX
-il T50SLJ_20221019T030731_B04_10m.jp2
T50SLJ_20221019T030731_B03_10m.jp2
T50SLJ_20221019T030731_B02_10m.jp2
T50SLJ_20221019T030731_B08_10m.jp2
-exp "{im1b1/im1b1Maxi;im2b1/im2b1Maxi;im3b1/im3b1Maxi;im4b1/im4b1Maxi}"
-out Sentinel-2_B4328_10m.tif

And then:
$ python3 sr.py --savedmodel sr4rs_savedmodel --input Sentinel-2_B4328_10m.tif --output out.tif

#######
#sr4rs_savedmodel is sr4rs_sentinel2_bands4328_france2020_savedmodel that I rename
#######

2022-11-04 14:44:31 (INFO): Loading metadata from official product
2022-11-04 14:44:31 (INFO) ReadImageInfo:
Image general information:
Number of bands : 4
Data type : float
No data flags : Not found
Start index : [0,0]
Size : [10980,10980]
Origin : [300005,4.40004e+06]
Spacing : [10,-10]
Estimated ground spacing (in meters): [9.97726,10.0167]

Image acquisition information:
Sensor :
Image projection : PROJCS["WGS 84 / UTM zone 50N",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Easting",EAST],AXIS["Northing",NORTH],AUTHORITY["EPSG","32650"]]

Image default RGB composition:
[R, G, B] = [0,1,2]

Ground control points information:
Number of GCPs = 0
GCPs projection =

Traceback (most recent call last):
File "sr.py", line 83, in
infer.SetParameterStringList("source1.il", [params.input])
AttributeError: 'NoneType' object has no attribute 'SetParameterStringList'

Thanks for your help and your time!

Hi @badmonkeyemail

These commands are meant to be run from inside the otbtf docker image.

Hi @remicres
Oop, I forgot it. Thank you.

I am running inside the docker image orfeotoolbox/otb:8.1.1 (latest) and getting this error using the command:

python3 sr4rs/code/sr.py --savedmodel sr4rs_sentinel2_bands4328_france2020_savedmodel --input s2_test_RGBNIR.tif --output test.tif

Image from wget https://github.com/capizziemanuele/sr4rs/raw/master/s2_test_RGBNIR.tif

Any ideas?

hi @robmarkcole

These commands are meant to be run from inside one otbtf docker image.