paddlepaddle-gpu在无GPU docker中运行CPU训练
Created by: Antsypc
-
版本、环境信息: 1)paddlepaddle-gpu-1.3.0.post97, python3.6 2)安装方式
pip install --upgrade paddlepaddle-gpu=1.3.0.post97
3)CPU:GenuineIntel Intel(R) Xeon(R) Gold 6154 CPU @ 3.00GHz 4)GPU:无 5)系统环境:docker Ubuntu 16.04 -
训练信息:单机,无卡
-
问题描述: 1)代码是 https://github.com/PaddlePaddle/book/tree/develop/03.image_classification 2) 运行
python train.py
3) 错误信息如下
W0319 07:05:17.251328 549 init.cc:89] Compiled with WITH_GPU, but no GPU found in runtime.
PLACE: CPUPlace
Traceback (most recent call last):
File "train.py", line 210, in <module>
main(use_cuda=False)
File "train.py", line 202, in main
train(use_cuda=use_cuda, params_dirname=save_path)
File "train.py", line 130, in train
train_loop()
File "train.py", line 104, in train_loop
exe.run(star_program)
File "/usr/local/lib/python3.6/dist-packages/paddle/fluid/executor.py", line 525, in run
use_program_cache=use_program_cache)
File "/usr/local/lib/python3.6/dist-packages/paddle/fluid/executor.py", line 591, in _run
exe.run(program.desc, scope, 0, True, True)
paddle.fluid.core.EnforceNotMet: Invoke operator fill_constant error.
Python Callstacks:
File "/usr/local/lib/python3.6/dist-packages/paddle/fluid/framework.py", line 1382, in _prepend_op
attrs=kwargs.get("attrs", None))
File "/usr/local/lib/python3.6/dist-packages/paddle/fluid/initializer.py", line 167, in __call__
stop_gradient=True)
File "/usr/local/lib/python3.6/dist-packages/paddle/fluid/framework.py", line 1198, in create_var
kwargs['initializer'](var, self)
File "/usr/local/lib/python3.6/dist-packages/paddle/fluid/layer_helper.py", line 402, in set_variable_initializer
initializer=initializer)
File "/usr/local/lib/python3.6/dist-packages/paddle/fluid/layers/tensor.py", line 137, in create_global_var
value=float(value), force_cpu=force_cpu))
File "/usr/local/lib/python3.6/dist-packages/paddle/fluid/optimizer.py", line 92, in _create_global_learning_rate
persistable=True)
File "/usr/local/lib/python3.6/dist-packages/paddle/fluid/optimizer.py", line 224, in _create_optimization_pass
self._create_global_learning_rate()
File "/usr/local/lib/python3.6/dist-packages/paddle/fluid/optimizer.py", line 350, in apply_gradients
optimize_ops = self._create_optimization_pass(params_grads)
File "/usr/local/lib/python3.6/dist-packages/paddle/fluid/optimizer.py", line 405, in minimize
optimize_ops = self.apply_gradients(params_grads)
File "train.py", line 72, in train
optimizer.minimize(avg_cost)
File "train.py", line 202, in main
train(use_cuda=use_cuda, params_dirname=save_path)
File "train.py", line 210, in <module>
main(use_cuda=False)
C++ Callstacks:
cudaGetDeviceCount failed in paddle::platform::GetCUDADeviceCount: unknown error at [/paddle/paddle/fluid/platform/gpu_info.cc:78]
PaddlePaddle Call Stacks:
0 0x7f88605b58d5p void paddle::platform::EnforceNotMet::Init<char const*>(char const*, char const*, int) + 357
1 0x7f88605b5c59p paddle::platform::EnforceNotMet::EnforceNotMet(std::__exception_ptr::exception_ptr, char const*, int) + 137
2 0x7f886207800cp paddle::platform::GetCUDADeviceCount() + 1036
3 0x7f88620680efp paddle::memory::allocation::AllocatorFacadePrivate::InitLegacyAllocator() + 175
4 0x7f88620648fbp paddle::memory::allocation::AllocatorFacade::AllocatorFacade() + 91
5 0x7f8862064dfcp paddle::memory::allocation::AllocatorFacade::Instance() + 76
6 0x7f8861d2630cp paddle::memory::AllocShared(boost::variant<paddle::platform::CUDAPlace, paddle::platform::CPUPlace, paddle::platform::CUDAPinnedPlace, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_> const&, unsigned long, paddle::memory::allocation::Allocator::Attr) + 28
7 0x7f8862021356p paddle::framework::Tensor::mutable_data(boost::variant<paddle::platform::CUDAPlace, paddle::platform::CPUPlace, paddle::platform::CUDAPinnedPlace, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_>, paddle::framework::proto::VarType_Type, paddle::memory::allocation::Allocator::Attr, unsigned long) + 150
8 0x7f8860a44101p paddle::operators::FillConstantKernel<float>::Compute(paddle::framework::ExecutionContext const&) const + 497
9 0x7f8860a44263p std::_Function_handler<void (paddle::framework::ExecutionContext const&), paddle::framework::OpKernelRegistrarFunctor<paddle::platform::CPUPlace, false, 0ul, paddle::operators::FillConstantKernel<float>, paddle::operators::FillConstantKernel<double>, paddle::operators::FillConstantKernel<long>, paddle::operators::FillConstantKernel<int>, paddle::operators::FillConstantKernel<paddle::platform::float16> >::operator()(char const*, char const*, int) const::{lambda(paddle::framework::ExecutionContext const&)#1}>::_M_invoke(std::_Any_data const&, paddle::framework::ExecutionContext const&) + 35
10 0x7f8861fc3d03p paddle::framework::OperatorWithKernel::RunImpl(paddle::framework::Scope const&, boost::variant<paddle::platform::CUDAPlace, paddle::platform::CPUPlace, paddle::platform::CUDAPinnedPlace, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_> const&) const + 659
11 0x7f8861fc1575p paddle::framework::OperatorBase::Run(paddle::framework::Scope const&, boost::variant<paddle::platform::CUDAPlace, paddle::platform::CPUPlace, paddle::platform::CUDAPinnedPlace, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_> const&) + 341
12 0x7f88606d241ap paddle::framework::Executor::RunPreparedContext(paddle::framework::ExecutorPrepareContext*, paddle::framework::Scope*, bool, bool, bool) + 218
13 0x7f88606d4415p paddle::framework::Executor::Run(paddle::framework::ProgramDesc const&, paddle::framework::Scope*, int, bool, bool) + 261
14 0x7f8860599f7bp
15 0x7f88605e0c9ep
16 0x4b33ecp _PyCFunction_FastCallKeywords + 428
17 0x544be8p
18 0x546e9dp _PyEval_EvalFrameDefault + 4141
19 0x544a85p
20 0x544d37p
21 0x546b0bp _PyEval_EvalFrameDefault + 3227
22 0x544a85p
23 0x544d37p
24 0x546e9dp _PyEval_EvalFrameDefault + 4141
25 0x544a85p
26 0x544d37p
27 0x546e9dp _PyEval_EvalFrameDefault + 4141
28 0x544a85p
29 0x544d37p
30 0x546b0bp _PyEval_EvalFrameDefault + 3227
31 0x544a85p
32 0x544d37p
33 0x546b0bp _PyEval_EvalFrameDefault + 3227
34 0x544a85p
35 0x545913p PyEval_EvalCode + 35
36 0x42b41fp PyRun_FileExFlags + 367
37 0x42b64cp PyRun_SimpleFileExFlags + 236
38 0x43fa15p Py_Main + 3461
39 0x421b62p main + 354
40 0x7f8924424830p __libc_start_main + 240
41 0x421c39p _start + 41