Otbtf Dockerimage

Hello everybody,

i wanted to give the otbtf (https://github.com/remicres/otbtf or https://mdl4eo.irstea.fr/2019/01/04/an-introduction-to-deep-learning-on-remote-sensing-images-tutorial/ ) a try, and build the docker image as described in the first link.
It worked well, TF and OTB built, and i tried to execute this Command in a created Container:

otbuser@a7d2ca73f76b:~$ otbcli_PolygonClassStatistics -vec /data/sub.shp -field class -in /data/My_used_image.tif -out vec_stats.xml

and i got following output:

2019-07-26 09:41:09 (INFO) PolygonClassStatistics: Default RAM limit for OTB is 512 MB
2019-07-26 09:41:09 (INFO) PolygonClassStatistics: GDAL maximum cache size is 1251 MB
2019-07-26 09:41:09 (INFO) PolygonClassStatistics: OTB will use at most 4 threads
2019-07-26 09:41:09 (INFO) PolygonClassStatistics: Elevation management: setting default height above ellipsoid to 0 meters
ERROR 1: Invalid index : 485381264
2019-07-26 09:41:09 (INFO): Estimated memory for full processing: 21.7798MB (avail.: 512 MB), optimal image partitioning: 1 blocks
2019-07-26 09:41:09 (INFO): Estimation will be performed in 1 blocks of 1060x678 pixels
/work/otb/superbuild_install/bin/otbApplicationLauncherCommandLine: symbol lookup error: /work/otb/superbuild_install/bin/…/lib/otb/applications/otbapp_PolygonClassStatistics.so: undefined symbol: ZN12OGRFieldDefnC1EPS

Do you have an idea, what went wrong here ?

the Input image is a VHR image, the vector file are polygons with a field “class” containing the class of the polygons.

thanks and best regards

Flo

Hi,
Thank you for noticing this issue.
I just take a look and indeed it seems to be something wrong with the linking of OGR libraries:

otbuser@f9561dd0b446:/data$ ld /work/otb/superbuild_install/lib//libOTBGdalAdapters-6.7.so.1 -v
GNU ld (GNU Binutils for Ubuntu) 2.30
ld: warning: cannot find entry symbol _start; not setting start address
/work/otb/superbuild_install/lib//libOTBGdalAdapters-6.7.so.1: undefined reference to `OGRFeature::GetFieldAsString(int)'
/work/otb/superbuild_install/lib//libOTBGdalAdapters-6.7.so.1: undefined reference to `OGRFeature::SetFrom(OGRFeature*, int*, int)'
/work/otb/superbuild_install/lib//libOTBGdalAdapters-6.7.so.1: undefined reference to `OGRFeature::IsFieldSetAndNotNull(int)'
/work/otb/superbuild_install/lib//libOTBGdalAdapters-6.7.so.1: undefined reference to `OGRFeature::GetFieldAsIntegerList(int, int*)'
/work/otb/superbuild_install/lib//libOTBGdalAdapters-6.7.so.1: undefined reference to `OGRFeature::Clone()'
/work/otb/superbuild_install/lib//libOTBGdalAdapters-6.7.so.1: undefined reference to `OGRSpatialReference::Validate()'
/work/otb/superbuild_install/lib//libOTBGdalAdapters-6.7.so.1: undefined reference to `OGRFeature::GetFieldAsDoubleList(int, int*)'
/work/otb/superbuild_install/lib//libOTBGdalAdapters-6.7.so.1: undefined reference to `OGRFeature::SetFrom(OGRFeature*, int)'
/work/otb/superbuild_install/lib//libOTBGdalAdapters-6.7.so.1: undefined reference to `OGRFeature::GetFieldAsDouble(int)'
/work/otb/superbuild_install/lib//libOTBGdalAdapters-6.7.so.1: undefined reference to `OGRFeature::GetFieldAsInteger(int)'

I am now looking how to correct the dockerfile. I suspect that the system version of GDAL is too recent for the otb version (GDAL: bionic package v2.4, OTB: develop branch 0df44b312d64d6c3890b65d3790d4a17d0fd5f23)

Maybe updating the OTB, or using the GDAL from superbuild should correct this.
I keep you updated once it’s fixed!

1 Like

Hello Remi,

Great, thank you very much !

best regards

Flo

@remi.cresson OTB is now using GDAL 2.4 so if it is the problem you can update it, but I think that bionic is still in gdal 2.2… (https://packages.ubuntu.com/source/bionic/gdal)

Thanks @Antoine, it looks weird that gdal 2.4 was installed instead of 2.2.

I have fixed the Dockerfile now, this should work!

1 Like

Dear Remi,

It Works now !

thanks and best regards

Florian

Hi,

which platform (windows or linux) you installed the docker image?

Hi @tzehuey85 ,

You should be able to install the latest OTBTF images on windows or linux.
Using the NVIDIA runtime is quite straightforward on linux, and some Windows users reported to have successfully used the docker image with their GPUs on Windows (see this discussion).

Also recently, we pushed additional docker images built with basic optimization flags to ensure compatibility with most hardware.

Finally you can built your own docker image using the dockerfile on your platform, with the options of your choice :slight_smile: (see the OTBTF docker use documentation)

Hope that helps!