使用PaddleVideo中的AttentionCluster模型做infer时的几个问题
Created by: haokuan361
请教作者几个问题,感谢! 1.做视频分类时,我使用AttentionCluster模型做infer,结果保存在AttentionCluster_infer_result.pkl文件中,但是不明白里面的数字表示的含义,怎样得到所测视频的类别呢? 2.在paddlepaddle/paddle:latest-gpu-cuda9.0-cudnn7镜像制作的容器中运行infer.py.我将use_gpu设置为False时能正常运行,设置为True时报错如下:
[INFO: infer.py: 169]: Namespace(batch_size=1, config='configs/attention_cluster.txt', filelist='/data4/hk/docker-hk_paddle/models-master/PaddleCV/PaddleVideo/dataset/youtube8m/val.list', infer_topk=20, log_interval=1, model_name='AttentionCluster', save_dir='./save', use_gpu=True, weights=None) W0701 12:56:50.640410 4601 device_context.cc:259] Please NOTE: device: 0, CUDA Capability: 61, Driver API Version: 9.1, Runtime API Version: 9.0 W0701 12:56:50.645512 4601 device_context.cc:267] device: 0, cuDNN Version: 7.4. Traceback (most recent call last): File "infer.py", line 171, in infer(args) File "infer.py", line 118, in infer fluid.default_main_program(), place) File "/data4/hk/docker-hk_paddle/models-master/PaddleCV/PaddleVideo/models/model.py", line 139, in load_test_weights fluid.io.load_params(exe, weights, main_program=prog) File "/usr/local/lib/python2.7/dist-packages/paddle/fluid/io.py", line 707, in load_params filename=filename) File "/usr/local/lib/python2.7/dist-packages/paddle/fluid/io.py", line 620, in load_vars filename=filename) File "/usr/local/lib/python2.7/dist-packages/paddle/fluid/io.py", line 657, in load_vars executor.run(load_prog) File "/usr/local/lib/python2.7/dist-packages/paddle/fluid/executor.py", line 650, in run use_program_cache=use_program_cache) File "/usr/local/lib/python2.7/dist-packages/paddle/fluid/executor.py", line 748, in run exe.run(program.desc, scope, 0, True, True, fetch_var_name) paddle.fluid.core_avx.EnforceNotMet: Invoke operator load error. Python Callstacks: File "/usr/local/lib/python2.7/dist-packages/paddle/fluid/framework.py", line 1766, in append_op attrs=kwargs.get("attrs", None)) File "/usr/local/lib/python2.7/dist-packages/paddle/fluid/io.py", line 642, in load_vars 'file_path': os.path.join(load_dirname, new_var.name) File "/usr/local/lib/python2.7/dist-packages/paddle/fluid/io.py", line 620, in load_vars filename=filename) File "/usr/local/lib/python2.7/dist-packages/paddle/fluid/io.py", line 707, in load_params filename=filename) File "/data4/hk/docker-hk_paddle/models-master/PaddleCV/PaddleVideo/models/model.py", line 139, in load_test_weights fluid.io.load_params(exe, weights, main_program=prog) File "infer.py", line 118, in infer fluid.default_main_program(), place) File "infer.py", line 171, in infer(args) C++ Callstacks: Enforce failed. Expected allocating <= available, but received allocating:10244597154 > available:711458560. Insufficient GPU memory to allocation. at [/paddle/paddle/fluid/platform/gpu_info.cc:262] PaddlePaddle Call Stacks: 0 0x7fe869864b98p void paddle::platform::EnforceNotMet::Initstd::string(std::string, char const*, int) + 360 1 0x7fe869864ee7p paddle::platform::EnforceNotMet::EnforceNotMet(std::string const&, char const*, int) + 87 2 0x7fe86b8d7776p paddle::platform::GpuMaxChunkSize() + 630 3 0x7fe86b8aba0ap 4 0x7fe9a702ba99p 5 0x7fe86b8ab0adp paddle::memory::legacy::GetGPUBuddyAllocator(int) + 109 6 0x7fe86b8abef5p void* paddle::memory::legacy::Allocpaddle::platform::CUDAPlace(paddle::platform::CUDAPlace const&, unsigned long) + 37 7 0x7fe86b8ac495p paddle::memory::allocation::LegacyAllocator::AllocateImpl(unsigned long) + 421 8 0x7fe86b8a0555p paddle::memory::allocation::AllocatorFacade::Alloc(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) + 181 9 0x7fe86b8a06dap paddle::memory::allocation::AllocatorFacade::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) + 26 10 0x7fe86b4a76acp 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) + 44 11 0x7fe86b872f84p 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, unsigned long) + 148 12 0x7fe86b876624p paddle::framework::TensorCopy(paddle::framework::Tensor 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&, paddle::platform::DeviceContext const&, paddle::framework::Tensor*) + 452 13 0x7fe86b87a21bp paddle::framework::TensorFromStream(std::istream&, paddle::framework::Tensor*, paddle::platform::DeviceContext const&) + 699 14 0x7fe86b462fb0p paddle::framework::DeserializeFromStream(std::istream&, paddle::framework::LoDTensor*, paddle::platform::DeviceContext const&) + 576 15 0x7fe86a32eb09p paddle::operators::LoadOpKernel<paddle::platform::CUDADeviceContext, float>::LoadLodTensor(std::istream&, 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&, paddle::framework::Variable*, paddle::framework::ExecutionContext const&) const + 89 16 0x7fe86a32f030p paddle::operators::LoadOpKernel<paddle::platform::CUDADeviceContext, float>::Compute(paddle::framework::ExecutionContext const&) const + 432 17 0x7fe86a32f3f3p std::Function_handler<void (paddle::framework::ExecutionContext const&), paddle::framework::OpKernelRegistrarFunctor<paddle::platform::CUDAPlace, false, 0ul, paddle::operators::LoadOpKernel<paddle::platform::CUDADeviceContext, float>, paddle::operators::LoadOpKernel<paddle::platform::CUDADeviceContext, double>, paddle::operators::LoadOpKernel<paddle::platform::CUDADeviceContext, int>, paddle::operators::LoadOpKernel<paddle::platform::CUDADeviceContext, signed char>, paddle::operators::LoadOpKernel<paddle::platform::CUDADeviceContext, long> >::operator()(char const*, char const*, int) const::{lambda(paddle::framework::ExecutionContext const&)#1 (closed)}>::M_invoke(std::Any_data const&, paddle::framework::ExecutionContext const&) + 35 18 0x7fe86b81d8c7p 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&, paddle::framework::RuntimeContext*) const + 375 19 0x7fe86b81dca1p 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 + 529 20 0x7fe86b81b2acp 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&) + 332 21 0x7fe8699f125ep paddle::framework::Executor::RunPreparedContext(paddle::framework::ExecutorPrepareContext*, paddle::framework::Scope*, bool, bool, bool) + 382 22 0x7fe8699f432fp paddle::framework::Executor::Run(paddle::framework::ProgramDesc const&, paddle::framework::Scope*, int, bool, bool, std::vector<std::string, std::allocatorstd::string > const&, bool) + 143 23 0x7fe869855b3dp 24 0x7fe8698974a6p 25 0x4c5326p PyEval_EvalFrameEx + 37958 26 0x4b9b66p PyEval_EvalCodeEx + 774 27 0x4c1f56p PyEval_EvalFrameEx + 24694 28 0x4b9b66p PyEval_EvalCodeEx + 774 29 0x4c17c6p PyEval_EvalFrameEx + 22758 30 0x4b9b66p PyEval_EvalCodeEx + 774 31 0x4c17c6p PyEval_EvalFrameEx + 22758 32 0x4b9b66p PyEval_EvalCodeEx + 774 33 0x4c17c6p PyEval_EvalFrameEx + 22758 34 0x4b9b66p PyEval_EvalCodeEx + 774 35 0x4c17c6p PyEval_EvalFrameEx + 22758 36 0x4c141fp PyEval_EvalFrameEx + 21823 37 0x4c141fp PyEval_EvalFrameEx + 21823 38 0x4b9b66p PyEval_EvalCodeEx + 774 39 0x4eb69fp 40 0x4e58f2p PyRun_FileExFlags + 130 41 0x4e41a6p PyRun_SimpleFileExFlags + 390 42 0x4938cep Py_Main + 1358 43 0x7fe9a6c73830p __libc_start_main + 240 44 0x493299p _start + 41