Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use MattingRefine? #172

Open
Willy-NotSpe opened this issue Feb 12, 2022 · 6 comments
Open

How to use MattingRefine? #172

Willy-NotSpe opened this issue Feb 12, 2022 · 6 comments

Comments

@Willy-NotSpe
Copy link

I got the following error message after input the src and bgr imge.
Please help me, thanks.

Traceback (most recent call last):
File "./Matting/inference_images.py", line 131, in
pha, fgr, _, _, err, ref = model(src, bgr)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/app/Matting/model/model.py", line 189, in forward
pha, fgr, ref_sm = self.refiner(src, bgr, pha_sm, fgr_sm, err_sm, hid_sm)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/app/Matting/model/refiner.py", line 95, in forward
ref = self.select_refinement_regions(err)
File "/app/Matting/model/refiner.py", line 175, in select_refinement_regions
idx = err.topk(self.sample_pixels // 16, dim=1, sorted=False).indices
RuntimeError: invalid argument 5: k not in range for dimension at /pytorch/aten/src/THC/generic/THCTensorTopK.cu:26

@Willy-NotSpe
Copy link
Author

Willy-NotSpe commented Mar 25, 2022 via email

@grewanhassan
Copy link

No no, you are right, you don't need to setup data_path.py.
Can You upload your input image and the related background?

@Willy-NotSpe
Copy link
Author

Sorry, I can't provide the data generated by the video.
Because the video was obtained from a private organization.

@grewanhassan
Copy link

Do You use inference_images?

@Willy-NotSpe
Copy link
Author

Yes. I don't know why two different model types have the same steps in the first place.
"mattingbase" can be done, but another cannot.

@OoKyleoO
Copy link

HI I've got the same problem here. Any solutions yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants