How do I install the most recent Tensorflow (here: 2.2) on Windows when conda does not yet support it?

前端 未结 4 1790
被撕碎了的回忆
被撕碎了的回忆 2020-12-17 02:01

I have conda 4.8.3 and Python 3.7.4 on Windows 8.1.

I have tf 2.0.0 installed in a conda environment. How do I upgrade to 2.2.x?

Or, how do I just install 2.2.

相关标签:
4条回答
  • 2020-12-17 02:13

    It's possible to install TF 2.2.0 now with either:

    pip install tensorflow-gpu==2.2.0
    

    or

    pip install https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-2.2.0-cp37-cp37m-win_amd64.whl
    

    ONE IMPORTANT THING: for now, at least in my case, there is a major problem with the GPU version. The old one recognises my GPU with no issues, while the latest doesn't see it for some reason. I advise you to create, just in case, a new env so you won't need to reinstall everything later on.

    EDIT by a reader:

    Better do not use pip install at all if you can wait for the conda version to catch up. Using the pip installer is not recommended, even if it often offers a more recent version. Using pip will risk exactly the documented error here. And you do not need to create a new env with conda update, conda update --all will not harm your dependencies in your env. See Why using Anaconda environments to install tensorflow on Windows?.

    0 讨论(0)
  • 2020-12-17 02:28

    There are two methods

    1. Install into virtual environment with

    pip TensorFlow
    
    virtualenv --system-site-packages -p python3 ./venv
    

    then you need to activate your new environment

    pip install --upgrade pip
    
    pip list  # show packages installed within the virtual environment
    this command for quit 
    deactivate  # don't exit until you're done using TensorFlow
    we finish by installing tensor 
    
    pip install --upgrade tensorflow
    

    2. Install in your system

    python3 --version
    pip3 --version
    virtualenv --version
    

    Ubuntu

    sudo apt update
    
    sudo apt install python3-dev python3-pip
    
    sudo pip3 install -U virtualenv  # system-wide install
    

    then

    pip3 install --user --upgrade tensorflow  # install in $HOME
    
    0 讨论(0)
  • 2020-12-17 02:28

    TF 2.2.0 isn't available on conda yet.

    0 讨论(0)
  • 2020-12-17 02:30

    create new environment and use this command in jupyter notebook :

    !pip install tensorflow==2.2-rc3
    

    this version work on CPU or GPU.

    0 讨论(0)
提交回复
热议问题