Search code examples
pythontensorflowjupyter-notebookversion

Jupyter environment error, loading different tensorflow version than installed


I am using ubuntu 20.04. I created a new environment.

conda create -n tfgpu python=3.8 conda activate tfgpu pip install tensorflow-gpu==2.3 jupyter notebook

Then I open a previously created .ipynb file and I try to import tensorflow. import tensorflow as tf tf.version

version is coming out to be 2.4.1 I had an installation of tensorflow 2.4.1 in my base environment. Even if it is unrelated, I uninstalled that. I checked for tf 2.4.1 in other environment too but could not find any. When I write !pip uninstall tensorflow in that notebook, it says Skipping as no tensorflow installed. When I write !pip uninstall tensorflow-gpu, it uninstalled tensorflow==2.3. And after that it was still able to import tensorflow which was 2.4.1 version. I do not understand what is happening. I can say that I once also installed tf-nightly but was in a different environment. I am thinking it is something related to path of installation or does it have anything to do with environment name. It is really annoying, any help is appreciated. Thank you.


Solution

  • I missed installing jupyter notebook. I do not yet understand what was happening, but my mistake was that. The problem is resolved.