kappazeta / cm-vsm

Tool to sub-tile Sentinel-2 products and preprocess segmentation masks from a variety of formats
Apache License 2.0
2 stars 0 forks source link

Update cm-vsm #24

Closed Falcoriders closed 2 years ago

Falcoriders commented 3 years ago

Good morning. I'm running into an issue where I'm supposed to update cm-vsm. A simple "git pull" tells me that I'm already up to date, so I suppose that I have to update my installation. As I'm not familiar with Cmake etc, I would like to know how I can update cm-vsm. Here is my issue (I run it on WSL): INFO: CMP: ========== INFO: CMP: ========== cm_predict version 1.0.4 INFO: CMP: ========== /bin/sh: 1: --version: not found /home/<user>/miniconda3/envs/cm_predict/lib/python3.9/site-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: - is an invalid version and will not be supported in a future release warnings.warn( ERROR: CMP: Please update cm-vsm to 0.2.6 or later

indrek-sunter commented 2 years ago

Hi, sorry for the delay. Thank you for opening the issue!

Have you tried rebuilding cm-vsm? You could try the following in your working copy of the cm-vsm repository:

cd vsm/build
make
sudo make install

I will try it out, I suspect that there is an issue with cm_predict, rather than cm-vsm.

indrek-sunter commented 2 years ago

Are you setting up cm-vsm for the first time, or have you built cm-vsm before?

It seems that there's also an issue with cm-vsm: its install prefix no longer defaults to /usr nor /usr/local.

In your cm_predict configuration file, what is the value of the variable cm_vsm_executable?

indrek-sunter commented 2 years ago

I reached a similar error messages when cm_vsm was not properly installed:

$ python cm_predict.py -c config/config.json
Using file logger for /home/sussch/Documents/projects/kz/cloudmask/cm_predict/cm_predict.log
INFO: CMP: ===========================================================================
INFO: CMP: ========== cm_predict version 1.0.4 
INFO: CMP: ===========================================================================
/bin/sh: 1: cm_vsm: not found
/home/sussch/micromamba/envs/cm_predict/lib/python3.9/site-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: - is an invalid version and will not be supported in a future release
warnings.warn(
ERROR: CMP: Please update cm-vsm to 0.2.6 or later

For you it reported /bin/sh: 1: --version: not found. The fact that the error message is different, probably meant that the Popen calls were not properly compatible with WSL. This should also be patched now.

indrek-sunter commented 2 years ago

@Falcoriders Perhaps you could try the following in your working copy of cm-vsm:

git fetch -a
git checkout 24-default-install-prefix
git pull
cd vsm/build
./clean.sh
cget install

Then, depending on your version of g++, you could replace g++-9 with g++-10, g++-8 or other. For this example I'm using g++-9:

cmake .. -DCMAKE_CXX_COMPILER=g++-9
sudo make install

Then in your working copy of cm_predict, you could do the following:

git fetch -a
git checkout 24-update-cm-vsm
git pull

I also found an issue with the most recent version of TensorFlow, https://github.com/kappazeta/cm_predict/issues/12. If you've already created the Conda environment, I would recommend to remove it and re-create it from scratch, as follows:

conda remove --all --name cm_predict
conda env create -f environment.yml

If Conda is too slow, then you could also use mamba (https://github.com/mamba-org/mamba).

Please let me know whether this works.

Best regards

indrek-sunter commented 2 years ago

Closing, for the changes are in master and it has been almost a year without updates if it's still an issue.