200字范文,内容丰富有趣,生活中的好帮手!
200字范文 > Windows 10 + anaconda3快速配置tensorflow-gpu开发环境

Windows 10 + anaconda3快速配置tensorflow-gpu开发环境

时间:2024-05-02 12:39:15

相关推荐

Windows 10 + anaconda3快速配置tensorflow-gpu开发环境

提前准备

配置环境:

Windows 10 64 bit 21H1

Anaconda 3

nVidia GeForce 940MX

打开anaconda prompt, 进行下面的操作

创建虚拟环境

conda create -n tf24 python=3.8

进入虚拟环境

conda actvate tf24

安装gpu加速支持

conda install cudatoolkit=11.0conda install cudnn

安装tf以及其他所需的包

pip install tensorflow==2.4.1

conda install matplotlib numpy=1.19.2 pandas pytables scikit-learn

验证:

Python 3.8.11 (default, Aug 6 , 09:57:55) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32Type "help", "copyright", "credits" or "license" for more information.>>> import tensorflow as tf-08-23 12:04:47.744830: I tensorflow/stream_executor/platform/default/:49] Successfully opened dynamic library cudart64_110.dll>>> tf.__version__'2.4.1'>>> tf.test.is_gpu_available()WARNING:tensorflow:From <stdin>:1: is_gpu_available (from tensorflow.python.framework.test_util) is deprecated and will be removed in a future version.Instructions for updating:Use `tf.config.list_physical_devices('GPU')` instead.-08-23 12:05:06.759898: I tensorflow/core/platform/:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.-08-23 12:05:06.777325: I tensorflow/stream_executor/platform/default/:49] Successfully opened dynamic library nvcuda.dll-08-23 12:05:07.122470: I tensorflow/core/common_runtime/gpu/:1720] Found device 0 with properties:pciBusID: 0000:01:00.0 name: GeForce 940MX computeCapability: 5.0coreClock: 1.189GHz coreCount: 3 deviceMemorySize: 2.00GiB deviceMemoryBandwidth: 37.33GiB/s-08-23 12:05:07.122644: I tensorflow/stream_executor/platform/default/:49] Successfully opened dynamic library cudart64_110.dll-08-23 12:05:07.135621: I tensorflow/stream_executor/platform/default/:49] Successfully opened dynamic library cublas64_11.dll-08-23 12:05:07.135794: I tensorflow/stream_executor/platform/default/:49] Successfully opened dynamic library cublasLt64_11.dll-08-23 12:05:07.140683: I tensorflow/stream_executor/platform/default/:49] Successfully opened dynamic library cufft64_10.dll-08-23 12:05:07.142265: I tensorflow/stream_executor/platform/default/:49] Successfully opened dynamic library curand64_10.dll-08-23 12:05:07.155482: I tensorflow/stream_executor/platform/default/:49] Successfully opened dynamic library cusolver64_10.dll-08-23 12:05:07.159036: I tensorflow/stream_executor/platform/default/:49] Successfully opened dynamic library cusparse64_11.dll-08-23 12:05:07.160264: I tensorflow/stream_executor/platform/default/:49] Successfully opened dynamic library cudnn64_8.dll-08-23 12:05:07.161300: I tensorflow/core/common_runtime/gpu/:1862] Adding visible gpu devices: 0-08-23 12:05:07.802464: I tensorflow/core/common_runtime/gpu/:1261] Device interconnect StreamExecutor with strength 1 edge matrix:-08-23 12:05:07.802594: I tensorflow/core/common_runtime/gpu/:1267]0-08-23 12:05:07.804007: I tensorflow/core/common_runtime/gpu/:1280] 0: N-08-23 12:05:07.805291: I tensorflow/core/common_runtime/gpu/:1406] Created TensorFlow device (/device:GPU:0 with 1368 MB memory) -> physical GPU (device: 0, name: GeForce 940MX, pci bus id: 0000:01:00.0, compute capability: 5.0)-08-23 12:05:07.813231: I tensorflow/compiler/jit/:99] Not creating XLA devices, tf_xla_enable_xla_devices not setTrue

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。