yucornetto / MGMatting

This repository includes the official project of Mask Guided (MG) Matting, presented in our paper: Mask Guided Matting via Progressive Refinement Network
Other
332 stars 48 forks source link

RuntimeError: "upsample_nearest2d_out_frame" not implemented for 'Byte' #4

Closed EricLe-dev closed 3 years ago

EricLe-dev commented 3 years ago

Hi @yucornetto,

Thank you so much for this awesome work. I try training the model with a very small dataset and ran the infer.py. However, I got this error straight away RuntimeError: "upsample_nearest2d_out_frame" not implemented for 'Byte' It seemed to be from

util.py in get_unknown_tensor_from_pred(pred, rand_width, train_mode) 244 weight = torch.from_numpy(weight).cuda() 245 --> 246 weight = F.interpolate(weight, size=(H,W), mode='nearest')

Can you please give me a small guide on how to fix it? Thank you so much!

EricLe-dev commented 3 years ago

Fixed by casting the tensor. Sorry for a stupid question.

yucornetto commented 3 years ago

Good to know your problem has been solved! Feel free to let me know if you encounter any other problem :)