首先 cuda 装的是 9.1.85_win10_64 位,是在百度网盘上下载的 local 可执行文件(因为官网的下载太慢而且联网版安装包也很慢),用 vs2015 测试自带 Samples 成功。
然后 cudnn 是下载官网的 9.0 版本,但是按照网上做法测试报错:
#include <iostream>
#include <cuda_runtime.h>
#include <cudnn.h>
using namespace std;
void main() {
cudnnHandle_t handle;
cudnnStatus_t t = cudnnCreate(&handle);
cout << cudnnGetErrorString(t);
getchar();
}
错误 MSB3721 命令“"D:\CUDA9.2\Development\bin\nvcc.exe" -gencode=arch=compute_30,code="sm_30,compute_30" --use-local-env --cl-version 2015 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin" -x cu -ID:\CUDA9.2\Development\include -ID:\CUDA9.2\Development\include -G --keep-dir Debug -maxrregcount=0 --machine 32 --compile -cudart static -g -D_MBCS -Xcompiler "/EHsc /W3 /nologo /Od /FS /Zi /RTC1 /MDd " -o Debug\test.cu.obj "C:\Users\24346\Documents\C++\testCUDA\test_cudnn\test_cudnn\test.cu"”已退出,返回代码为 1。
Microsoft Visual C++ 2017 Redistributable(X64)已安装
python 是 3.6.8 版本的 64 位,pip install tensorflow-gpu 显示安装成功,但 import tensorflow 报错:
ImportError: Traceback (most recent call last):
File "D:\anaconda\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
return importlib.import_module(mname)
File "D:\anaconda\envs\tensorflow-gpu\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 978, in _gcd_import
File "<frozen importlib._bootstrap>", line 961, in _find_and_load
File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 648, in _load_unlocked
File "<frozen importlib._bootstrap>", line 560, in module_from_spec
File "<frozen importlib._bootstrap_external>", line 922, in create_module
File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
ImportError: DLL load failed: 找不到指定的模块。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\anaconda\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 41, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "D:\anaconda\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 21, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "D:\anaconda\envs\tensorflow-gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
return importlib.import_module('_pywrap_tensorflow_internal')
File "D:\anaconda\envs\tensorflow-gpu\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/install_sources#common_installation_problems
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
使用 anaconda 安装 tensorflow-gpu 也出现这个 ImportError
现在我安装了 tensorflow 的 cpu 版就没有这个问题了。。。
想问一下 10000 条以内评论的词向量训练需要显卡加速吗
1
julyclyde 2019-02-14 12:53:43 +08:00
Failed to load the native TensorFlow runtime
|
2
kisara 2019-02-14 17:29:03 +08:00
为啥在 windows 上装 tf 这不是跟自己过不去嘛。。
|
3
KarlRixon OP cudnn 测试需要在链接器输入中添加 cudart.lib
|
4
tinywhale 2019-02-21 07:22:43 +08:00
是 cuda 版本不对,版本号要和编译时用的一样
|