PaddleDetection icon indicating copy to clipboard operation
PaddleDetection copied to clipboard

solov2 执行eval时出错

Open xiaowen0110 opened this issue 5 years ago • 4 comments

paddle版本2.0rc paddledetection版本0.5, cuda10.1,可以训练 2020-12-10 20:58:13,846-INFO: Test iter 0 W1210 20:58:14.454932 14512 operator.cc:205] cast raises an exception class thrust::system::system_error, transform: failed to synchronize: cudaErrorIllegalAddress: an illegal memory access was encountered Traceback (most recent call last): File "tools/eval.py", line 179, in main() File "tools/eval.py", line 146, in main sub_eval_prog, sub_keys, sub_values, resolution) File "D:\paddledetection\ppdet\utils\eval_utils.py", line 148, in eval_run return_numpy=False) File "C:\Users\User\Anaconda3\envs\paddle_env\lib\site-packages\paddle\fluid\executor.py", line 1107, in run six.reraise(*sys.exc_info()) File "C:\Users\User\Anaconda3\envs\paddle_env\lib\site-packages\six.py", line 703, in reraise raise value File "C:\Users\User\Anaconda3\envs\paddle_env\lib\site-packages\paddle\fluid\executor.py", line 1105, in run return_merged=return_merged) File "C:\Users\User\Anaconda3\envs\paddle_env\lib\site-packages\paddle\fluid\executor.py", line 1242, in _run_impl return_merged=return_merged) File "C:\Users\User\Anaconda3\envs\paddle_env\lib\site-packages\paddle\fluid\executor.py", line 910, in _run_parallel tensors = exe.run(fetch_var_names, return_merged)._move_to_list() paddle.fluid.core_avx.EnforceNotMet:


C++ Traceback (most recent call last):

Not support stack backtrace yet.


Error Message Summary:

ExternalError: Cuda error(700), an illegal memory access was encountered. [Advise: Please search for the error code(700) on website( https://docs.nvidia.com/cuda/archive/10.0/cuda-runtime-api/group__CUDART__TYPES.html#group__CUDART__TYPES_1g3f51e3575c2178246db0a94a430e0038 ) to get Nvidia's official solution about CUDA Error.] (at D:\2.0.0-rc0\paddle\paddle\fluid\platform\stream\cuda_stream.cc:65)

xiaowen0110 avatar Dec 10 '20 13:12 xiaowen0110

@XiaoWen-AI 我们复现不了你这个错误,请问使用tools/infer.py可以预测吗?

yghstill avatar Dec 11 '20 02:12 yghstill

使用tools/infer.py可以预测。我尝试对部署的模型使用C++ 进行预测,推理出的tensor类型为int64_t 后处理代码 std::vector out_data;

auto output_names = predictor->GetOutputNames();
auto output_t = predictor->GetOutputHandle(output_names[0]);
std::vector<int> output_shape = output_t->shape();
int out_num = std::accumulate(output_shape.begin(), output_shape.end(), 1, std::multiplies<int>());
out_data.resize(out_num);
output_t->CopyToCpu(out_data.data());

W0207 10:41:26.266502 8348 device_context.cc:330] device: 0, cuDNN Version: 7.6. (InvalidArgument) Tensor holds the wrong type, it holds int64_t, but desires to be float [Hint: Expected valid == true, but received valid:0 != true:1.] (at D:\2.0.0rc1\paddle\paddle/fluid/framework/tensor_impl.h:51) [Hint: If you need C++ stacktraces for debugging, please set FLAGS_call_stack_level=2.]

gsdust avatar Feb 07 '21 02:02 gsdust

你确认一下output_names对应输出的tensor分别是什么,可参考https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.0-rc/deploy/python/infer.py#L276-L280 分别是np_label、np_score、np_segms

yghstill avatar Mar 05 '21 03:03 yghstill

你确认一下output_names对应输出的tensor分别是什么,可参考https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.0-rc/deploy/python/infer.py#L276-L280 分别是np_label、np_score、np_segms

已正确部署,感谢

gsdust avatar Mar 08 '21 10:03 gsdust