-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
plugin in gqis2 for osx doesn't recognize scikit-learn #10
Comments
I never tried it on OSX. |
OK Had an error there. Looks like QGIS for mac includes its own python.
I put a copy of sklearn in there and now it will accept random forest.
Now I get an error:
Something went wrong during the training. Please make sure you respect
these conditions : - Are you sure to have only integer values in your
Roadi column ? - Do your shapefile and raster have the same projection ?
I have checked my shapfile - Roadi is an integer (tried versions of both
integer and integer 64). Also tried cases where the values are three
classes 1,2,3 , and a set where the values are two classes 0,1
Both projections are epsg 32611
Looks like the other models (Gaussian, Support Vector, etc)
Is there anything else I can try?
Ken
… Nicolas Karasiak ***@***.***>
April 10, 2018 at 2:11 AM
I never tried it on OSX. When you open QGIS, run the Python Console
(https://docs.qgis.org/2.18/en/docs/user_manual/plugins/python_console.html)
and enter : |import sklearn| Does this generate an error ? If yes,
scikit learn is not well installed.
— You are receiving this because you authored the thread. Reply to
this email directly, view it on GitHub
<#10 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AC0QA4A986XPX7NsXW0hBYjqNBd-c30zks5tnHczgaJpZM4TL8fO>.
|
Hello Ken, Did this work when you use the sample dataset ? I just upload a new version on Qgis repository (V2.5.3) which should be available to download asap. PS : when you type : |
Hi Yes I'm using
QGIS 2.18.15
RF works with your sample data
After upgrading the plugin on my data I get a different error when
trying mine
2018-04-11T10:37:37 1 Traceback (most recent call last):
File "/Users/knussear/.qgis2/python/plugins/dzetsaka/dzetsaka.py", line
1114, in runMagic
temp.initPredict(inRaster,model,outRaster,inMask,confidenceMap,inClassifier)
File
"/Users/knussear/.qgis2/python/plugins/dzetsaka/scripts/mainfunction.py",
line 314, in initPredict
predictedImage=self.predict_image(inRaster,outRaster,tree,inMask,confidenceMap,-10000,SCALE=[M,m],classifier=classifier)
UnboundLocalError: local variable 'tree' referenced before assignment
Ken
… Nicolas Karasiak ***@***.***>
April 11, 2018 at 7:52 AM
Hello Ken, Can you tell me what Qgis version are you using ?
Did this work when you use the sample dataset
<https://github.com/lennepkade/dzetsaka/archive/docs.zip> ?
I just upload a new version on Qgis repository (V2.5.3) which should
be available to download asap.
PS : when you type : |import scipy| Did this generate an error ?
— You are receiving this because you authored the thread. Reply to
this email directly, view it on GitHub
<#10 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AC0QA93pNEuDG2b0ANpuGmR-N5mDxHlkks5tnhiUgaJpZM4TL8fO>.
|
I'm getting a similar error on Windows 10. My setup is installed via osgeo4w.
I get the following error when testing the dzetsaka sample project.
|
If you tried with samples data and with RF/GMM algorithms and if it works, could you please send me a little sample of your data (shape/raster) to test it on my side ? Just to know, how many bands have your raster ? Does it have an alpha band ? If yes, try with removing it. |
I successfully ran the sample data using RF and GMM from the plugin's panel. If I try to "train algorithm" from the processing toolbox, I get the above error on the sample data, and the same for my own data. When I run my own data using the plugin's "perform the classification" button it immediately gives a python error:
My raster is singleband with no alpha band. |
I try with the sample dataset with just the first band and it goes well.
Only this error, but I need to desactivate loading model/confusion matrix after algorithm has run. Error is shown but everything worked. |
Ah I've made some rookie mistakes. I was attempting to run on temporary files to try to automate the process, and should not have chosen a non-GMM function for my NDVI rasters. The RF function works from the plugin panel using a locally-saved RGB composite. If I train the algorithm from the processing toolbox, what should the file extension be for the model? |
Whatever you want. model.rf for example, or model.algo... It doesn't affect
the process :)
|
Hello, I work on Windows 7 and I'm using QGIS 2.18.13, Python 3.7. |
Hello @SIGGIF , |
Most likely the same problem than #15, see my response |
Trying to run random forest for qgis2 on osx with your plugin. Says it needs scikit-learn. Following instructions with pip I get
Requirement already satisfied: scikit-learn in ./anaconda2/lib/python2.7/site-packages
Yet the plugin doesn't recognize the installation.
The text was updated successfully, but these errors were encountered: