deepseek-ai / deepseek-ai/Janus

macOS 15.1.1 (24B91),M3 chip , 使用1B模型时(通过 app_januspro.py),图片对话正常,但生成图片报错 RuntimeError: Input type (c10::BFloat16) and bias type (c10::Half) should be the same,

Open
#83 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
17.8k
Forks
2.2k
PR merge metrics
No merged PRs in 30d

Description

raceback (most recent call last):
File "/Users/eliascheung/Documents/Janus/WORKENV/lib/python3.8/site-packages/gradio/queueing.py", line 536, in process_events
response = await route_utils.call_process_api(
File "/Users/eliascheung/Documents/Janus/WORKENV/lib/python3.8/site-packages/gradio/route_utils.py", line 322, in call_process_api
output = await app.get_blocks().process_api(
File "/Users/eliascheung/Documents/Janus/WORKENV/lib/python3.8/site-packages/gradio/blocks.py", line 1935, in process_api
result = await self.call_function(
File "/Users/eliascheung/Documents/Janus/WORKENV/lib/python3.8/site-packages/gradio/blocks.py", line 1520, in call_function
prediction = await anyio.to_thread.run_sync( # type: ignore
File "/Users/eliascheung/Documents/Janus/WORKENV/lib/python3.8/site-packages/anyio/to_thread.py", line 56, in run_sync
return await get_async_backend().run_sync_in_worker_thread(
File "/Users/eliascheung/Documents/Janus/WORKENV/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 2364, in run_sync_in_worker_thread
return await future
File "/Users/eliascheung/Documents/Janus/WORKENV/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 864, in run
result = context.run(func, *args)
File "/Users/eliascheung/Documents/Janus/WORKENV/lib/python3.8/site-packages/gradio/utils.py", line 826, in wrapper
response = f(*args, **kwargs)
File "/Users/eliascheung/Documents/Janus/WORKENV/lib/python3.8/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
return func(*args, **kwargs)
File "./demo/app_januspro.py", line 160, in generate_image
output, patches = generate(input_ids,
File "./demo/app_januspro.py", line 118, in generate
patches = vl_gpt.gen_vision_model.decode_code(generated_tokens.to(dtype=torch.int),
File "/Users/eliascheung/Documents/Janus/janus/models/vq_model.py", line 507, in decode_code
dec = self.decode(quant_b)
File "/Users/eliascheung/Documents/Janus/janus/models/vq_model.py", line 502, in decode
dec = self.decoder(quant)
File "/Users/eliascheung/Documents/Janus/WORKENV/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/Users/eliascheung/Documents/Janus/WORKENV/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
File "/Users/eliascheung/Documents/Janus/janus/models/vq_model.py", line 208, in forward
h = block.upsample(h)
File "/Users/eliascheung/Documents/Janus/WORKENV/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/Users/eliascheung/Documents/Janus/WORKENV/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
File "/Users/eliascheung/Documents/Janus/janus/models/vq_model.py", line 426, in forward
x = self.conv(x)
File "/Users/eliascheung/Documents/Janus/WORKENV/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1553, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "/Users/eliascheung/Documents/Janus/WORKENV/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1562, in _call_impl
return forward_call(*args, **kwargs)
File "/Users/eliascheung/Documents/Janus/WORKENV/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 458, in forward
return self._conv_forward(input, self.weight, self.bias)
File "/Users/eliascheung/Documents/Janus/WORKENV/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 454, in _conv_forward
return F.conv2d(input, weight, bias, self.stride,
RuntimeError: Input type (c10::BFloat16) and bias type (c10::Half) should be the same

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the 1B image-generation path in demo/app_januspro.py, especially generate_image and generate, on the reported macOS M3 setup. Trace the decode path through janus/models/vq_model.py, including decode, decode_code, and the upsample block, then run the same generation flow to confirm it completes without the reported dtype error and produces an image.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
computer-vision, machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.