W0112 15:49:59.300688 4370 device_context.cc:236] Please NOTE: device: 0, CUDA Capability: 61, Driver API Version: 9.0, Runtime API Version: 9.0
W0112 15:49:59.300832 4370 dynamic_loader.cc:120] Can not find library: libcudnn.so. The process maybe hang. Please try to add the lib path to LD_LIBRARY_PATH.
W0112 15:49:59.300853 4370 dynamic_loader.cc:179] Failed to find dynamic library: libcudnn.so ( libcudnn.so: cannot open shared object file: No such file or directory )
Please specify its path correctly using following ways:
Method. set environment variable LD_LIBRARY_PATH on Linux or DYLD_LIBRARY_PATH on Mac OS.
For instance, issue command: export LD_LIBRARY_PATH=...
Note: After Mac OS 10.11, using the DYLD_LIBRARY_PATH is impossible unless System Integrity Protection (SIP) is disabled.
/home/yiyun/mycode/CCPD-master/venv/lib/python3.6/site-packages/paddle/fluid/executor.py:779: UserWarning: The following exception is not an EOF exception.
"The following exception is not an EOF exception.")
Traceback (most recent call last):
File "/home/yiyun/mycode/book-develop/01.fit_a_line/train.py", line 201, in
main()
File "/home/yiyun/mycode/book-develop/01.fit_a_line/train.py", line 120, in main
exe.run(startup_program)
File "/home/yiyun/mycode/CCPD-master/venv/lib/python3.6/site-packages/paddle/fluid/executor.py", line 780, in run
six.reraise(*sys.exc_info())
File "/home/yiyun/mycode/CCPD-master/venv/lib/python3.6/site-packages/six.py", line 696, in reraise
raise value
File "/home/yiyun/mycode/CCPD-master/venv/lib/python3.6/site-packages/paddle/fluid/executor.py", line 775, in run
use_program_cache=use_program_cache)
File "/home/yiyun/mycode/CCPD-master/venv/lib/python3.6/site-packages/paddle/fluid/executor.py", line 822, in _run_impl
use_program_cache=use_program_cache)
File "/home/yiyun/mycode/CCPD-master/venv/lib/python3.6/site-packages/paddle/fluid/executor.py", line 899, in _run_program
fetch_var_name)
paddle.fluid.core_avx.EnforceNotMet:
--------------------------------------------
C++ Call Stacks (More useful to developers):
--------------------------------------------
0 std::string paddle::platform::GetTraceBackString(char const*&&, char const*, int)
1 paddle::platform::EnforceNotMet::EnforceNotMet(std::__exception_ptr::exception_ptr, char const*, int)
2 paddle::platform::dynload::EnforceCUDNNLoaded(char const*)
3 paddle::platform::CUDADeviceContext::CUDADeviceContext(paddle::platform::CUDAPlace)
4 std::_Function_handler > (), std::reference_wrapper(std::map > >, std::less, std::allocator > > > > >*, paddle::platform::Place)::{lambda()#1} ()> > >::_M_invoke(std::_Any_data const&)
5 std::_Function_handler (), std::__future_base::_Task_setter > >, std::__future_base::_Result_base::_Deleter>, std::unique_ptr > > >::_M_invoke(std::_Any_data const&)
6 std::__future_base::_State_base::_M_do_set(std::function ()>&, bool&)
7 std::__future_base::_Deferred_state(std::map > >, std::less, std::allocator > > > > >*, paddle::platform::Place)::{lambda()#1} ()>, std::unique_ptr > >::_M_run_deferred()
8 paddle::platform::DeviceContextPool::Get(paddle::platform::Place const&)
9 paddle::framework::GarbageCollector::GarbageCollector(paddle::platform::Place const&, unsigned long)
10 paddle::framework::UnsafeFastGPUGarbageCollector::UnsafeFastGPUGarbageCollector(paddle::platform::CUDAPlace const&, unsigned long)
11 paddle::framework::Executor::RunPreparedContext(paddle::framework::ExecutorPrepareContext*, paddle::framework::Scope*, bool, bool, bool)
12 paddle::framework::Executor::Run(paddle::framework::ProgramDesc const&, paddle::framework::Scope*, int, bool, bool, std::vector > const&, bool)
----------------------
Error Message Summary:
----------------------
Error: Cannot load cudnn shared library. Cannot invoke method cudnnGetVersion at (/paddle/paddle/fluid/platform/dynload/cudnn.cc:59)
Process finished with exit code 1
正解,不是cuda cudnn安装问题就是pycharm问题,找了半天的cudnn问题,结果直接终端运行代码不会报错,pycharm就是报错。
我刚刚遇到这个问题,对应版本如下:
参考https://blog.csdn.net/qq451882471/article/details/106967942 解决了一下
但是发现在终端可以正常运行,VSCode上面运行却还报这个错误
这个和PyCharm应该是类似的,,可以初始化一下软连接