Within MLWIC, 'Classify' cannot find TensorFlow module and throws the error:
> ## Example from Tabak etal.
> setwd("G:/PHD_Research/[R]_SCRIPTS/Remote_Image_ID/MLWIC_examples-master")
> classify(path_prefix = "G:/PHD_Research/[R]_SCRIPTS/Remote_Image_ID/MLWIC_examples-master/images", # this is the absolute path to the images.
+ data_info = "G:/PHD_Research/[R]_SCRIPTS/Remote_Image_ID/MLWIC_examples-master/image_labels.csv", # this is the location of the csv containing image information. It has Unix linebreaks and no headers.
+ model_dir = "G:/PHD_Research/[R]_SCRIPTS/Remote_Image_ID", # assuming this is where you stored the L1 folder in Step 3 of the instructions: github.com/mikeyEcology/MLWIC/blob/master/README
+ python_loc = "D:/Programs/Anaconda/", # the location of Python 2.7 on your computer (version 3.6 installed on tpetroelje).
+ save_predictions = "model_predictions.txt" # this is the default and you should use it unless you have reason otherwise.
+ )
Traceback (most recent call last):
File "eval.py", line 13, in <module>
import tensorflow as tf
ModuleNotFoundError: No module named 'tensorflow'
[1] "evaluation of images took 0.206021070480347. The results are stored in G:/PHD_Research/[R]_SCRIPTS/Remote_Image_ID/L1/model_predictions.txt. To view the results in a viewer-friendly format, please use the function make_output"
However, when I run 'import tensorflow as tf' within anaconda I have no problems
(base) C:\Users\tpetroelje>activate tensorflow
(tensorflow) C:\Users\tpetroelje>python
Python 3.6.6 |Anaconda, Inc.| (default, Jun 28 2018, 11:27:44) [MSC v.1900 64 bi
t (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
2018-08-24 09:46:57.651529: I T:\src\github\tensorflow\tensorflow\core\platform\
cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow bi
nary was not compiled to use: AVX2
>>> print(sess.run(hello))
b'Hello, TensorFlow!'
>>>
Due to the differences in installation on Windows, I am wondering if this is related to a file path issue. It may be painfully obvious that I am quite new to anaconda and tensorflow, so this may be a straightforward fix I am not seeing.
Thank you!
Note: Some Windows users may be interested in this additional step when installing TensorFlow. If you receive an error when installing TensorFlow (No module named 'tensorflow') within the conda environment you created, you may need to upgrade setuptools prior to installing TensorFlow.
Thank you @tpetroel!
I don't have access to a Windows machine that can test this, so I appreciate you providing this Fix. I have linked to your description in the readme.
Within MLWIC, 'setup' throws the error:
Within MLWIC, 'Classify' cannot find TensorFlow module and throws the error:
However, when I run 'import tensorflow as tf' within anaconda I have no problems
Due to the differences in installation on Windows, I am wondering if this is related to a file path issue. It may be painfully obvious that I am quite new to anaconda and tensorflow, so this may be a straightforward fix I am not seeing.
Thank you!
Note: Some Windows users may be interested in this additional step when installing TensorFlow. If you receive an error when installing TensorFlow (No module named 'tensorflow') within the conda environment you created, you may need to upgrade setuptools prior to installing TensorFlow.
Upgrade setuptools:
(tensorflow)C:> pip install --upgrade -I setuptools
Then install TensorFlow for CPU within the created conda environment
(tensorflow)C:> pip install --ignore-installed --upgrade tensorflow
See more detailed explanation of fix via https://github.com/tensorflow/tensorflow/issues/6136