Skip to content
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

Python location #30

Open
alicehua11 opened this issue Sep 26, 2019 · 2 comments
Open

Python location #30

alicehua11 opened this issue Sep 26, 2019 · 2 comments

Comments

@alicehua11
Copy link

Hi,
I tried running the classify function for the example provided and still couldn't run it after reading through the Stackoverflow and reinstalling numpy. I have:

setup(python_loc = "C:/Users/alice/Anaconda3/", conda_loc = "auto" )
That ran fine with exception of "Error: Error 1 occurred installing packages into conda environment r-reticulate" which is fine under the README

Then in my classify(), I have:
python_loc = "C:/Users/alice/Anaconda3/bin/"
It says the result is stored in the path listed but there is no model_predictions.txt.

Then I tried:
python_loc = "C:/Users/alice/Anaconda3/"
This gives me a error :

"Traceback (most recent call last):
File "C:\Users\alice\ANACON~2\lib\site-packages\numpy\core_init
.py", line 16, in
from . import multiarray
ImportError: DLL load failed: The specified module could not be found."_

I then traced to the init.py and found line 16, not sure why the module is not found because multiarray is in there along with this init file. I reinstalled numpy, still no luck.
Any thought?

@mikeyEcology
Copy link
Owner

Hi @alicehua11 can you please post the full command that you specified for classify and the full output that you got?

@alicehua11
Copy link
Author

alicehua11 commented Oct 5, 2019

Hi Mike,

I have resolved this issue on my own. Apparently the package reticulate needs to be installed.
The Error 1 occurred installing packages into conda environment r-reticulate needs to be addressed. It is not fine according to the README.
From what I read, reticulate allows the connection between Python and R.
Here is what I did. I found this path from running the py_discover_config() in the console.

#install.packages("reticulate")
library(reticulate)
reticulate::use_python("C:\\Users\\alice\\AppData\\Local\\Programs\\Python\\Python36\\")

Then I had to delete ANACON~2, a hidden directory that R keeps referring to when it looks for numpy. This is how I know.

py_discover_config()
rm ANACON~2 rf

There is a tensorflow version problem as well, I had to downgrade tensorflow v2 to v1.4 because it did not have the attribute slice_input_producer.

classify(path_prefix = "D:/Cal_Spring_2019/URAP/photo_classification/images", # this is the absolute path to the images. 
         data_info = "D:/Cal_Spring_2019/URAP/photo_classification/image_labels.csv", 
         model_dir = "D:/Cal_Spring_2019/URAP/photo_classification", # assuming this is where you stored the L1 folder in Step 3 of the instructions: github.com/mikeyEcology/MLWIC/blob/master/README
         python_loc = "C:\\Users\\alice\\AppData\\Local\\Programs\\Python\\Python36\\", # the location of Python on your computer. 
         save_predictions = "model_predictions.txt" # this is the default and you should use it unless you have reason otherwise.
         )

Now my classify command looks like this and it has been working thus far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants