Object-Based Classification

175 views
Skip to first unread message

RODRIGO NUNES

unread,
Jan 22, 2018, 10:01:11 AM1/22/18
to rsgislib...@googlegroups.com
Hi colleagues, I have an issue when running the classification script from the RSGISLib_IntroTraining_Jan2017 course:

When I try to run the '16_PerformObjClass.py' script it gives an error:

> (py35) RNSOUSA@RODRIGO_NUNES:/mnt/c/RSGISLIB$ python 16_PerformObjClass.py

Traceback (most recent call last):
  File "16_PerformObjClass_LANDSAT.py", line 4, in <module>
    from rsgislib import rastergis
  File "/home/RNSOUSA/.conda/envs/py35/lib/python3.5/site-packages/rsgislib/rastergis/__init__.py", line 6, in <module>
    from ._rastergis import *
ImportError: libboost_filesystem.so.1.65.1: cannot open shared object file: No such file or directory

I am running the Miniconda 4.3.31, Python 3.5.4 and rsgislib 3.4.9 on Linux bash on Windows10.

Then I used the command: 
>  conda update -c conda-forge --all

And runned again, it gives:

(py35) RNSOUSA@RODRIGO_NUNES:/mnt/c/RSGISLIB$ python 16_PerformObjClass_LANDSAT.py

Traceback (most recent call last):
  File "16_PerformObjClass_LANDSAT.py", line 4, in <module>
    from rsgislib import rastergis
  File "/home/RNSOUSA/.conda/envs/py35/lib/python3.5/site-packages/rsgislib/rastergis/__init__.py", line 6, in <module>
    from ._rastergis import *
ImportError: /home/RNSOUSA/.conda/envs/py35/lib/python3.5/site-packages/rsgislib/rastergis/../../../.././libgdal.so.20: undefined symbol: _ZN6kmldom5ParseERKSsPSs

And after,

> conda update --all

After

> conda update --all

(osgeo) RNSOUSA@RODRIGO_NUNES:/mnt/c/RSGISLIB$ python 16_PerformObjClass.py

Traceback (most recent call last):
  File "16_PerformObjClass.py", line 3, in <module>
    from rsgislib import rastergis
  File "/home/RNSOUSA/.conda/envs/osgeo/lib/python3.6/site-packages/rsgislib/rastergis/__init__.py", line 6, in <module>
    from ._rastergis import *
ImportError: libboost_filesystem.so.1.65.1: cannot open shared object file: No such file or directory

Thanks

Daniel Clewley

unread,
Jan 22, 2018, 4:11:09 PM1/22/18
to RODRIGO NUNES, RSGISLib Support
Hi Rodrigo,

I’m not sure why this isn’t working. Could you try installing from scratch in a new environment and see if you have any luck with this?

conda create -n rsgislib-new -c conda-forge rsgislib

Thanks,

Dan

On 22 Jan 2018, at 15:01, RODRIGO NUNES <rodrigon...@gmail.com> wrote:

Hi colleagues, I have an issue when running the classification script from the RSGISLib_IntroTraining_Jan2017 course:

When I try to run the '16_PerformObjClass.py' script it gives an error:

> (py35) RNSOUSA@RODRIGO_NUNES:/mnt/c/RSGISLIB$ python 16_PerformObjClass.py

Traceback (most recent call last):
  File "16_PerformObjClass_LANDSAT.py", line 4, in <module>
    from rsgislib import rastergis
  File "/home/RNSOUSA/.conda/envs/py35/lib/python3.5/site-packages/rsgislib/rastergis/__init__.py", line 6, in <module>
    from ._rastergis import *
ImportError: libboost_filesystem.so.1.65.1: cannot open shared object file: No such file or directory

I am running the Miniconda 4.3.31, Python 3.5.4 and rsgislib 3.4.9 on Linux bash on Windows10.

I already used the command: 
>  conda update --all

Thanks

--
You received this message because you are subscribed to the Google Groups "RSGISLib Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rsgislib-suppo...@googlegroups.com.
To post to this group, send email to rsgislib...@googlegroups.com.
Visit this group at https://groups.google.com/group/rsgislib-support.
For more options, visit https://groups.google.com/d/optout.

Daniel Clewley

unread,
Jan 22, 2018, 4:44:02 PM1/22/18
to RODRIGO NUNES, RSGISLib Support
Have you also tried:

conda update --all

in the new environment?

Can you please make sure you keep rsgislib...@googlegroups.com cc’d when replying.

Thanks,

Dan

On 22 Jan 2018, at 21:42, RODRIGO NUNES <rodrigon...@gmail.com> wrote:

Hi Dan,

Still not working..

After running:

conda create -n osgeo -c conda-forge rsgislib

> source activate osgeo

It gives..

> (osgeo) RNSOUSA@RODRIGO_NUNES:/mnt/c/RSGISLIB$ python 16_PerformObjClass_LANDSAT.py

Traceback (most recent call last):
  File "16_PerformObjClass_LANDSAT.py", line 4, in <module>
    from rsgislib import rastergis
  File "/home/RNSOUSA/.conda/envs/osgeo/lib/python3.6/site-packages/rsgislib/rastergis/__init__.py", line 6, in <module>
    from ._rastergis import *
ImportError: libopenblas.so.0: cannot open shared object file: No such file or directory

Rodrigo Nunes de Sousa
Biologist, Ph.D. candidate in Ecology and Biodiversity at UNESP - RC
Skype: rnsousa


2018-01-22 19:17 GMT-02:00 RODRIGO NUNES <rodrigon...@gmail.com>:
Thanks Dan.. I'll try it and call you back..

Rodrigo Nunes de Sousa
Biologist, Ph.D. candidate in Ecology and Biodiversity at UNESP - RC
Skype: rnsousa


2018-01-22 19:11 GMT-02:00 Daniel Clewley <daniel....@gmail.com>:
Hi Rodrigo,

I’m not sure why this isn’t working. Could you try installing from scratch in a new environment and see if you have any luck with this?

conda create -n rsgislib-new -c conda-forge rsgislib

Thanks,

Dan

On 22 Jan 2018, at 15:01, RODRIGO NUNES <rodrigon...@gmail.com> wrote:

Hi colleagues, I have an issue when running the classification script from the RSGISLib_IntroTraining_Jan2017 course:

When I try to run the '16_PerformObjClass.py' script it gives an error:

> (py35) RNSOUSA@RODRIGO_NUNES:/mnt/c/RSGISLIB$ python 16_PerformObjClass.py

Traceback (most recent call last):
  File "16_PerformObjClass_LANDSAT.py", line 4, in <module>
    from rsgislib import rastergis
  File "/home/RNSOUSA/.conda/envs/py35/lib/python3.5/site-packages/rsgislib/rastergis/__init__.py", line 6, in <module>
    from ._rastergis import *
ImportError: libboost_filesystem.so.1.65.1: cannot open shared object file: No such file or directory

I am running the Miniconda 4.3.31, Python 3.5.4 and rsgislib 3.4.9 on Linux bash on Windows10.

I already used the command: 
>  conda update --all

Thanks

--
You received this message because you are subscribed to the Google Groups "RSGISLib Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rsgislib-support+unsubscribe@googlegroups.com.
To post to this group, send email to rsgislib-support@googlegroups.com.

RODRIGO NUNES

unread,
Jan 25, 2018, 5:44:42 PM1/25/18
to RSGISLib Support
HI Dan,

How can I install the older version of rsgislib?

I tried downloading the rsgislib-2.0.0.tar.gz from bitbucket, from: https://bitbucket.org/petebunting/rsgislib/downloads/ ...

Extract the file and "cd" to the "\rsgislib-2.0.0\python" directory

And tried to install using the command > python ./setup.py install

Them received ERRORS:

(osgeo) RNSOUSA@THOROS:/mnt/c/iMAGENS/Janauaca/GRD_IW/rsgislib-2.0.0/python$ python ./setup.py install
running install
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building extension "imagecalc._imagecalc" sources
building extension "imageutils._imageutils" sources
building extension "segmentation._segmentation" sources
building extension "imagecalibration._imagecalibration" sources
building extension "rastergis._rastergis" sources
build_src: building npy-pkg config files
running build_py
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
building 'imagecalc._imagecalc' extension
compiling C++ sources
C compiler: g++ -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC

compile options: '-I../src/cmds -I../src -I/home/RNSOUSA/miniconda3/envs/osgeo/lib/python3.6/site-packages/numpy/core/include -I/home/RNSOUSA/miniconda3/envs/osgeo/include/python3.6m -c'
g++: src/imagecalc.cpp
sh: 1: g++: not found
sh: 1: g++: not found
error: Command "g++ -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I../src/cmds -I../src -I/home/RNSOUSA/miniconda3/envs/osgeo/lib/python3.6/site-packages/numpy/core/include -I/home/RNSOUSA/miniconda3/envs/osgeo/include/python3.6m -c src/imagecalc.cpp -o build/temp.linux-x86_64-3.6/src/imagecalc.o" failed with exit status 127

Daniel Clewley

unread,
Jan 26, 2018, 2:32:58 AM1/26/18
to RODRIGO NUNES, RSGISLib Support
Hi Rodrigo,

You need to build the C++ library first (in the main directory) using cmake. If you are building against the packages in conda you will need to make sure cmake finds them.

However, it looks like the error you are getting is because you don’t have a c++ compiler installed.

I don’t know if you saw my message yesterday to the list which relates to your previous problem:

I think the conda-forge builds of RSGISLib need to be updated for a different version of boost, there is a pull request open for it:

https://github.com/conda-forge/rsgislib-feedstock/pull/9

Should be fixed in the next couple of days - will post when it is for you to test. 

Thanks,

Dan

-- 
You received this message because you are subscribed to the Google Groups "RSGISLib Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rsgislib-suppo...@googlegroups.com.
To post to this group, send email to rsgislib...@googlegroups.com.

RODRIGO NUNES

unread,
Jan 26, 2018, 5:36:16 PM1/26/18
to RSGISLib Support
Thanks Dan,

T'll wait for the new build at conda-forge..

RODRIGO NUNES

unread,
Feb 1, 2018, 3:36:16 PM2/1/18
to RSGISLib Support
HI Dan and Chewley, I installed and updated the new rsgislib build at conda-forge.

Although when I run the Object-Based Classification script ('16_PerformObjClass.py') it goes right until..

"....
Running Rasterise now...
Traceback (most recent call last):
  File "16_PerformObjClass.py", line 51, in <module>
    ratutils.populateClumpsWithClassTraining(clumpsImg, classesDict, tmpPath, classesIntColIn, classesNameCol)
  File "/home/RNSOUSA/.conda/envs/rsgislib-new/lib/python3.6/site-packages/rsgislib/rastergis/ratutils.py", line 1168, in populateClumpsWithClassTraining
    vectorutils.rasterise2Image(classShpFile, clumpsImg, classImgFile, gdalformat="KEA", burnVal=classIntVal)
  File "/home/RNSOUSA/.conda/envs/rsgislib-new/lib/python3.6/site-packages/rsgislib/vectorutils/__init__.py", line 96, in rasterise2Image
    raise e
  File "/home/RNSOUSA/.conda/envs/rsgislib-new/lib/python3.6/site-packages/rsgislib/vectorutils/__init__.py", line 73, in rasterise2Image
    inVectorLayer = inVectorDS.GetLayer(0)
AttributeError: 'NoneType' object has no attribute 'GetLayer' "

How to solve  this?
Reply all
Reply to author
Forward
0 new messages