-
Notifications
You must be signed in to change notification settings - Fork 17
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
Classify having trouble finding python #14
Comments
I don't understand why it's not finding python. Can you open your terminal and type |
If you're able to run python from the command line like this, then let's try adding
This will print the command that is being passed to python. Then in your terminal window, exit python by typing |
I was able to open python and typing print(2+2) yielded an answer of 4, so it appears to be working. I then did everything you suggested in the last comment. However, when I remove print_cmd=TRUE, I still get the message saying that the classify function did not run properly. |
Yes-it's not running properly because it's printing something instead of running, but it should have printed a system call that will look like |
Yes it printed this: "/anaconda3/bin/python run.py eval --num_threads 4 --architecture resnet --depth 18 --log_dir species_model --snapshot_prefix species_model --path_prefix /home/pmcmahon/Documents/MLWIC2_Package_Images --batch_size 128 --val_info /home/pmcmahon/Documents/image_labels.csv --delimiter , --save_predictions /home/pmcmahon/Documents/MLWIC2_helper_files/model_predictions.txt --top_n 5 --num_gpus 2 --num_classes 1000\n" |
Ok. so copy that and paste it into your python, which you can get to by typing |
I did that, but nothing has changed. |
Is there an error? Otherwise it will be running in the background. Does this file exist |
I wasn't sure if I should remove print_cmd=TRUE or not. If I leave it in the command, this is the output: Your If I remove it, this is the output: Your So there was an error and that file doesn't exist. |
What happens if in the terminal you navigate to |
It output this: |
Sorry. In type |
Ok I changed to that directory and typed the command, but got the same error message |
what is in your |
data_info_train.csv __MACOSX MLWIC2_helper_files MLWIC2_test_tf.py |
Ok. Something went wrong when you downloaded the helper files folder. Can you try downloading it from the readme and unzipping it. It should contain:
|
Ok I downloaded it again and it contains all those things. However, I'm getting the same errors when running the classify command |
Ok. Try this again: in terminal type cd |
Here's the output after doing that: Traceback (most recent call last): |
This means that tensorflow is not installed properly. I recently updated the |
I ran setup again and got this output when I ran classify: Your I then ran those commands in the terminal and got the same output when I tried running classify again |
What was your output when you ran it in the terminal? |
Collecting tensorflow |
Shoot, I forgot you need the right version of tensorflow. In conda run |
After running the uninstall command twice, I got this: But when I ran the install command I got: |
try |
Nah, I got the same error |
The problem is you're using the wrong python version. You can change it in conda by using |
Ok I installed python3.7 and tensorflow1.14.0, but classify gave me the same error |
Did you try running it from the terminal? |
I'm not sure what you mean. What should I run in the terminal? |
type |
I ran those commands, but I am not seeing any differences when I run classify in R. Do I need to make any changes to the R command? |
What do you mean you don't see any differences? Did you run this from the terminal? |
I mean that when I run classify in R, I still get the same error that I've been getting the whole time. I did run that command in the terminal, but it didn't do anything. Am I supposed to be running classify through the terminal as well? R is really the only programming language I have any meaningful experience with, so I have no idea what these commands I'm running in the terminal are supposed to be doing. |
What do you mean it didn't do anything in the terminal? Nothing showed up when you ran this command? We're only using the terminal to troubleshoot. |
I ran that in the terminal and this was the output: |
You need to install tensorflow. Type |
Ok I did that. This was the output: Requirement already satisfied: tensorflow==1.14 in /home/pmcmahon/anaconda3/envs/r-reticulate/lib/python3.7/site-packages (1.14.0) Since it said, requirement already satisfied, I tried the previous command again and this was the output: 2020-09-29 13:42:30.294548: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2691265000 Hz During handling of the above exception, another exception occurred: Traceback (most recent call last): Errors may have originated from an input operation. Original stack trace for 'batch': |
Ok. Now everything is working except you have some mistake in your paths. It's looking for images at |
I'm not entirely sure what you mean. /home/pmcmahon/Documents/MLWIC2_Package_Images/C:/Users/winst/Documents/USDA/MLWIC2 Package Images/ doesn't exist and I'm not sure why it'd be looking for the images there. The images are stored at /home/pmcmahon/Documents/MLWIC2_Package_Images |
Right. The problem is that it doesn't exist, but in your output, it is looking for these images
So you must have the C:/.. in your code or image label file somewhere. |
I don't see that in the code anywhere. Both the code I used in R and the code I used in the terminal have the correct path. I also don't know how the image label file could be wrong because I thought that's just where the images are saved on this computer. So I'm not sure what's causing that or how to fix it. |
Ok I think I got that issue fixed |
I'm trying to get this package to work with just the example images and example code, but I get an error about not being able to find python even though it's installed in the exact location I've specified. Here's the code and the error:
classify(path_prefix = "/home/pmcmahon/Documents/MLWIC2_Package_Images",
data_info = "/home/pmcmahon/Documents/image_labels.csv",
model_dir = "/home/pmcmahon/Documents/MLWIC2_helper_files",
python_loc = "/anaconda3/bin/",
save_predictions = "model_predictions.txt",
make_output = TRUE,
output_name = "MLWIC2_output.csv",
num_cores = 4
)
Your
data_info
file exists: /home/pmcmahon/Documents/image_labels.csv.Your `path_prefix exists: /home/pmcmahon/Documents/MLWIC2_Package_Images.
You are not using a Windows computer.
sh: 1: /anaconda3/bin/python: not found
The classify function did not run properly.
Warning message:
In system(eval_py) : error in running command
The text was updated successfully, but these errors were encountered: