@dambo  we use cv::cuda::resize, it save some time.
And we run model in GPU, Therefore, it is most appropriate to generate tensor directly from the GPU, eliminating the operation  “tensor.to(device)”.
From your answer, it seems that it does not explain why segmentfault.
Can you explain more in detail?