Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem of Tensorflow2.0 installation in Linux

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to solve the problem of Tensorflow2.0 installation in Linux, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

Conda update condapip install tf-nightly-gpu-2.0-previewconda install https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/linux-64/cudnn-7.3.1-cuda10.0_0.tar.bz2conda install https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/linux-64/cudatoolkit-10.0.130-0.tar.bz2

Description:

First you need to update the conda

The latest version of tf2.0 is installed

Cudnn7.3.1 and cudatoolkit-10.0 versions, which can be downloaded and installed locally

Wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/linux-64/cudnn-7.3.1-cuda10.0_0.tar.bz2conda install cudnn-7.3.1-cuda10.0_0.tar.bz2

Errors and solutions

The problem of old library

ERROR: Cannot uninstall 'wrapt'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

The old version is too dependent to be deleted clearly. The upgrade of the old version should be ignored at this time, that is, the following solution: pip install tf-nightly-gpu-2.0-preview-ignore-installed wrapt

Numpy version issu

Another problem is that there is an old version of numpy. You can use pip to uninstall numpy until you are prompted that there is nothing to uninstall, and then reinstall numpy

Driving problem

Tensorflow.python.framework.errors_impl.InternalError: cudaGetDevice () failed. Status: CUDA driver version is insufficient for CUDA runtime version

This is due to the mismatch of the driver version. You can download the driver of cuda10.0 (consistent with the above) from the NVIDIA official website.

Installation command: https://juejin.im/post/5cce44e3f265da036902a89c, and then all the way to determine, and finally use watch nvidia-smi

View the results:

Testing and other

The test is available:

Import tensorflow as tfprint (tf.__version__) print (tf.keras.__version__) if tf.test.is_gpu_available (): device = "/ gpu:0" else: device = "/ cpu:0" print (device)

Reduce tensorflow output information

There are four levels of log information in TensorFlow, increasing in importance to: INFO (notification)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report