如何让Keras在GPU上运行?

huangapple go评论67阅读模式
英文:

How can I get Keras to run on GPU?

问题

我刚刚开始使用神经网络,并且有一个卷积神经网络(CNN),我想通过在我的GPU上运行该过程来加速。但是我在设置这个过程时遇到了很多困难,我去过的不同网站和教程似乎都已过时或不再维护,我一直被引导进入兔子洞,最终一无所获。

我导入了Python以及我所有的模块,包括NumPy、Keras等,都是使用pip安装的,并且正在使用Visual Studio Code运行代码。

我已经按照一些教程的指导进行了一些操作,似乎要我更新/安装驱动程序,安装Visual Studio,安装CUDA工具包,安装zlib,安装cuDNN,设置路径变量并复制文件,因为自动安装程序不存在。但是在这一点上,我被困在了理解我在做什么的阶段,感到非常迷失。如果有人有任何建议或可以提供一个最新的教程,请告诉我!主要我正在按照这个教程进行操作:https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html?ncid=em-prod-337416,并在第2.3.5步卡住了,因为我不太了解Visual Studio的工作方式(我只是安装了它)。似乎我在做一些非常错误的事情,所以如果有人能提供任何建议或帮助,即使你不确定,我也会非常感激!

英文:

I am just getting started with neural networks, and have a CNN that I want to speed up by running the process on my GPU. However I am having a lot of difficulty setting this up, different websites and tutorials I go to seem to be out of date or deprecated, and I keep getting led down rabbit holes and ending up nowhere.

I imported python and all of my modules including numpy, keras, etc., have been installing using pip and am running the code using visual studio code.

I have followed a few tutorials that seemed to have me updating/installing drivers, installing visual studio, installing the cuda toolkit, installing zlib, installing cuDNN, setting path variables and copying files since automatic installers were not there. And at this point I got stuck in understanding what I am doing and am very lost. If anyone has any advice or can reference an up to date tutorial please let me know! Primarily I was following this tutorial: https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html?ncid=em-prod-337416, and got stuck at step 2.3.5, since I don't really know how visual studio works(I just installed it). It seems I am doing something really off so I would appreciate any advice or help even if you are uncertain!

答案1

得分: 1

请按照此TensorFlow安装页面中的逐步说明重新尝试在您的系统上安装TensorFlow,并检查是否满足所有硬件/系统要求以设置GPU支持。

请确保您已安装python 3.7-3.10tensorflow <=2.10以在Windows上设置TensorFlow GPU,因为如已测试的构建配置中所述,仅支持2.10或更早版本的本机Windows上的GPU支持,从TF 2.11开始,不支持Windows上的CUDA构建

现在尝试从与您安装TensorFlow并进行GPU设置的conda VirEnv相同的环境中安装并启动VScode。

请参考此类似问题供您参考。

英文:

Please try again by following the step by step instructions mentioned in this TF install page to install tensorflow in your system and check all the Hardware/System requirements satisfied to setup GPU support with Tensorflow.

Please ensure you have installed python 3.7-3.10 and tensorflow &lt;=2.10 to setup tensorflow GPU on Windows because GPU support on native-Windows is only available for 2.10 or earlier versions, starting in TF 2.11, CUDA build is not supported for Windows as mentioned in this tested build configuration.

Now try installing and launching the VScode from the same conda VirEnv where you have installed tensorflow and performed GPU setup.

Please check this similar issue for your reference.

huangapple
  • 本文由 发表于 2023年6月9日 05:46:14
  • 转载请务必保留本文链接:https://go.coder-hub.com/76435897.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定