lancercat / VSDF

23 stars 5 forks source link

How to run inference on single image? #7

Closed XTMeow closed 1 year ago

XTMeow commented 1 year ago

Thank you for your hard work! My problem is I dont know how to run inference on single image. I would be very appreciate if you can show me how to do it.

lancercat commented 1 year ago

Please refer to section IV of the manul.pdf.

XTMeow commented 1 year ago

I ran the code but it seems my gpu (2060) doesnt have enough vram. Thank you for your reply.

lancercat commented 1 year ago

Shan't be... Single image tests should only take 1.8Gib of vram or a little bit more than that... image

XTMeow commented 1 year ago

I wonder why that error appeared on my machine. But I added "with torch.no_grad()" into the "pretest" function in file "neko_abstract_jtr.py" and my error disappeared. Screenshot from 2023-02-14 13-43-13 My result: Screenshot from 2023-02-14 13-55-39 I dont know if my modification affected anything.

lancercat commented 1 year ago

Maybe you have a huge character set? (Just realized that you are handling CJK) Adding "with torch.no_grad()" is sure a valid fix to the vram issue, and it should bring no adversary affects.

I will merge this fix now, and huge thx for the feedback.