hassancs91 / Image-Background-Remover-Python

Remove Backgrounds From Images with u2net Trained model
103 stars 70 forks source link

RuntimeError #4

Open suhan21 opened 2 years ago

suhan21 commented 2 years ago

Traceback (most recent call last): File "/home/suhan/DLPro/Image-Background-Remover-Python-main/init.py", line 113, in print(removeBg(imgPath)) File "/home/suhan/DLPro/Image-Background-Remover-Python-main/init.py", line 82, in removeBg d1, d2, d3, d4, d5, d6, d7 = net(image)

RuntimeError: Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same or input should be a MKLDNN tensor and weight is a dense tensor

Hi , I have install all the necessary packages and i use interpreter as conda. I Got the above error. I can't able to solve. Please, can you help me to solve this.Thanks in advance.

hassancs91 commented 2 years ago

what type of images you are testing with?

suhan21 commented 1 year ago

I have testing as the same cat image, even i also used python default interpreter / conda(base) interpreter i can't solve runtime error. Here, i attached the screenshot.

Screenshot from 2022-07-06 16-05-53

suhan21 commented 1 year ago

hassan Please Can you help me to solve this issues

Thanks in advance

Armando1206 commented 1 year ago

I have the same problem, can u help us?

BhaumikThakkar commented 1 year ago

hassan Please Can you help me to solve this issues

Thanks in advance

Try on google colab

njupt99lee commented 1 year ago

I have testing as the same cat image, even i also used python default interpreter / conda(base) interpreter i can't solve runtime error. Here, i attached the screenshot.

Screenshot from 2022-07-06 16-05-53

try this : line 81 image = image.type(torch.FloatTensor) -> image = image.type(torch.cuda.FloatTensor)