am试图运行Keras代码。一切正常。除了我想知道为什么培训要花这么多时间。直到我了解到,gpu才被检测到。我尝试通过下面的简单代码测试是否检测到了GPU, 图像上方红色框显示的错误位于图片上方。请让我知道如何解决此问题。 还有一件事,我安装了tensorflow V1.15,因为某些模块在V2中已发布,因此我不得不对其进行降级。 https://i.stack.imgur.com/mfoRM.jpg
>>> import tensorflow as tf
>>> tf.test.is_built_with_cuda()
True
>>> tf.test.is_gpu_available(cuda_only=False, min_cuda_compute_capability=None)
2020-02-23 19:18:48.893786: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2020-02-23 19:18:48.911886: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library nvcuda.dll
2020-02-23 19:18:49.717223: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1618] Found device 0 with properties:
name: GeForce GTX 1050 Ti major: 6 minor: 1 memoryClockRate(GHz): 1.62
pciBusID: 0000:01:00.0
2020-02-23 19:18:49.722976: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_100.dll
2020-02-23 19:18:49.728562: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cublas64_100.dll'; dlerror: cublas64_100.dll not found
2020-02-23 19:18:49.734177: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cufft64_100.dll'; dlerror: cufft64_100.dll not found
2020-02-23 19:18:49.740876: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'curand64_100.dll'; dlerror: curand64_100.dll not found
2020-02-23 19:18:49.748607: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cusolver64_100.dll'; dlerror: cusolver64_100.dll not found
2020-02-23 19:18:49.756587: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cusparse64_100.dll'; dlerror: cusparse64_100.dll not found
2020-02-23 19:18:49.862997: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudnn64_7.dll
2020-02-23 19:18:49.869116: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1641] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
2020-02-23 19:18:50.439029: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1159] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-02-23 19:18:50.444445: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1165] 0
2020-02-23 19:18:50.447461: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1178] 0: N
False
答案 0 :(得分:0)
好吧,当我将其升级到v2时,它现在可以工作。我可以使用 tf.v1.compat 重用所有不推荐使用的代码。 例如,tf.get_session被描述。现在我可以通过编写在V2中使用它, tf.v1.compat.get_session ,它可以正常工作。