Ubuntu下安装Tensorflow的CPU版本

    科技2024-12-06  38

    Ubuntu下安装Tensorflow的CPU版本

    查看版本:需要使用 Python 3.5-3.8、pip 和 venv 19.0 及更高版本

    python3 --version pip3 --version

    版本升级方法:

    sudo apt update sudo apt install python3-dev python3-pip python3-venv

    安装TensorFlow 软件包依赖项

    pip install -U --user pip six numpy wheel setuptools mock 'future>=0.17.1' pip install -U --user keras_applications --no-deps pip install -U --user keras_preprocessing --no-deps

    安装Tensorflow

    pip3 install --user --upgrade tensorflow

    若出现错误

    ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependency conflicts. We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default. pyasn1-modules 0.2.8 requires pyasn1<0.5.0,>=0.4.6, but you'll have pyasn1 0.1.9 which is incompatible.

    则使用以下语句安装

    pip3 install --use-feature=2020-resolver --upgrade tensorflow

    参考网址: 使用pip安装Tensorflow

    Processed: 0.011, SQL: 8