So I had lots of trouble getting tensorflow to work in jupyter notebook, but after much trial and error and installing it in several different places not knowing what I was doing, I did what this guy said and it worked:
‘https://www.youtube.com/watch?v=CMYE6wMBx40’
He basically says to install tensorflow in anaconda, and then change from the base (root) environment to the tensorflow environment that we create and launch jupyter notebook from there, as shown in these images:
What I click:
Proof that tensorflow works in jupyter notebook now:
Now I want tensorflow to work in VS Code, but following the same route as before doesn’t work. I go into the tensorflow/tf environment I created in anaconda, launch VS Code from there, open a jupyter notebook file in VS Code and it doesn’t work:
What I click:
So now that you know the story, my question is (and I’m crossing my fingers tightly hoping that someone knows how all this installing business works and why):
Thank you @manimaran_p, your suggestion worked! I didn’t realise I could choose a kernel with the tf environment (probably because I don’t know what the environment or the kernel are). Could you explain this by any chance?
@JaimeGGB as @manimaran_p suggested, try following the steps in the section mentioned above (selecting a kernel using a “kernel picker” in VS Code Jupyter notebook)
I found the solution for my Vscode with these update code “pip”
conda create -n tensorflow python=3.5
activate tensorflow
pip install --ignore-installed --upgrade tensorflow
If the python version is not 3.5 in your actual environment in vscode , please change the version number.