BjornNyberg / Geometric-Attributes-Toolbox

The Geometric Attributes toolbox is a set of QGIS tools designed for the geometric attribute and shape characterization of modern depositional elements
GNU General Public License v3.0
67 stars 8 forks source link

Python uncompatibility for SAM #15

Closed cycle4 closed 1 year ago

cycle4 commented 1 year ago

Hello ! Thank you for the development of this useful tool ! My issue happens with the SAM model. The error I get when I try to run the segmentation process with the right checkpoint paths and a valid image is the following :

image

As you can see, even if Python 3.10 is the one used by QGIS (3.28 is the last ltr so should not need any update), the error says that I should have a Python version over 3.8... which is the case.

I also had problems when running the configuration, but managed to go around by installing the checkpoints by myself, and by running the command os.system('pip install segment-geospatial') in the Python console of QGIS to be able to import samgeo. I still get this error after running the configuration process : image

Can you help me with that please ? Feel free to ask for more details if needed !

I am working on Ubuntu 22.04.2LTS

BjornNyberg commented 1 year ago

Hi @cycle4

Did you manage to solve the issue? I havent personally tested with Ubuntu but if you remove these lines does it solve the problem? Alternatively, if you open the python console within QGIS and type:

import sys print(sys.version[:3])

what message do you receive? Perhaps a better way to implement this check if anyone has a suggestion.

BjornNyberg commented 1 year ago

@cycle4

I think the problem is solved now. Please reinstall the plugin from the plugin manager and let me know if your issue is resolved.

cycle4 commented 1 year ago

Hello @BjornNyberg Thank you for your answer ! Yes it seems to work now even without removing the line specifying the version in the Python file you attached. I now have a problem of memory allocation with Pythorch, but I was able to solve it when running SAM directly on Python so it should not be a problem Thanks again !