Janus icon indicating copy to clipboard operation
Janus copied to clipboard

CPU inference leads to 'RuntimeError: Input type (c10::BFloat16) and bias type (c10::Half) should be the same' - please review proposed fix

Open flobeier opened this issue 11 months ago • 4 comments

I have no NVIDIA card, so I'm using just my CPU for inference when running demo/app_januspro.py. However, this fails after a while with the following error message: RuntimeError: Input type (c10::BFloat16) and bias type (c10::Half) should be the same

I got it working and opened PR #65. However, it should be reviewed by someone with more PyTorch experience than me to ensure that the fix is valid and doesn't break GPU inference.

flobeier avatar Jan 28 '25 14:01 flobeier

I had same problem on mac and here's my solution for reference: https://github.com/takahirosir/Janus/commit/ff1e732981695b08c35f7356e04c89bb925906bf#diff-1b6c4cb1987bfffe1eba923c8b618df435472bfa1544712d10e491cd3b852c93

Image

takahirosir avatar Jan 28 '25 19:01 takahirosir

@takahirosir thanks for your hard work on the mac port.

vaiden avatar Jan 28 '25 19:01 vaiden

@takahirosir thanks, looks like you found the root cause for the issue 👍

flobeier avatar Jan 29 '25 16:01 flobeier

issue observed on a non-mac cpu, as well

synergiator avatar Mar 29 '25 13:03 synergiator