fix mmseg output sync (#2122)

pull/2292/head
Chen Xin 2023-05-30 14:06:04 +08:00 committed by GitHub
parent 012a754511
commit 25cea0ac0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -57,6 +57,7 @@ class ResizeMask : public MMSegmentation {
auto input_width = preprocess_result["img_metas"]["ori_shape"][2].get<int>();
Device host{"cpu"};
OUTCOME_TRY(auto host_tensor, MakeAvailableOnDevice(mask, host, stream_));
OUTCOME_TRY(stream().Wait()); // should sync even mask is on cpu
if (!with_argmax_) {
// (C, H, W) -> (H, W, C)
::mmdeploy::operation::Context ctx(host, stream_);