Reputation: 11
I am completely new to tensorflow and have some questions about running the demo models. I have installed tensorflow in a venv with anaconda and also cloned the whole GitHub tensorflow repo into a seperate folder on my mac (don't know if that is necessary, maybe someone could explain?).
1) When trying to run the convolutional.py demo from within the cloned repo it does not run and outputs an error like "no module named tensorflow.python.keras found". If I understood correctly during my search in the net, it is because the python where keras and the models are installed to might be different from the one running the script?
2) If I try to run the convolutional.py file from within the anaconda venv directory it does not output such an error but after a few seconds it just returns to the terminal prompt. Is it correct, or should there be some output when run correctly? I have read running this model could take aroudn half an hour and am wondering, why it just runs a few seconds for me?
Upvotes: 0
Views: 209
Reputation: 1818
[I am assuming a UNIX system here, though the commands only slightly change for Windows.]
1) Either you haven't installed keras AND tensorflow, or you installed it in another copy of python. When you created your venv you will have used a line like this:
conda create --name my_super_env tensorflow keras
In order to use that environment, you need to activate it. You need to do this every time you open a new terminal if you want to use the copy of python you've made in that virtual environment.
source activate my_super_env
If you're curious you can check which python you're using
which python
To check which modules are installed in the active environment you can use
conda list
If you're missing keras, tensorflow, or any other dependency, this will do the trick:
conda install keras
2) I'm assuming you mean this demo model which does have plenty of print statements, so I would take the lack of output to mean it's not really running. I would try running it after activating the environment as indicated above, and if you still see no output, write your own print statements inside the code to try to debug it (or post the line of code you're using to run convolutional.py).
Upvotes: 1