mirror of
https://github.com/deepseek-ai/Janus.git
synced 2026-11-05 00:57:18 +00:00
[GH-ISSUE #169] 是否支持传入多张图片? #133
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/Janus#133
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @fggggg7142 on GitHub (Feb 14, 2025).
Original GitHub issue: https://github.com/deepseek-ai/Janus/issues/169
传2以及2张以上图片报错:
Traceback (most recent call last):
File "/home/wanghui/daiteng01/deepseek/main.py", line 104, in
prepare_inputs = vl_chat_processor(
File "/home/wanghui/daiteng01/deepseek/Janus-main/janus/models/processing_vlm.py", line 353, in call
prepare = self.batchify([prepare])
File "/home/wanghui/daiteng01/deepseek/Janus-main/janus/models/processing_vlm.py", line 403, in batchify
batched_pixel_values[i, :n_image] = prepare.pixel_values
RuntimeError: The expanded size of the tensor (1) must match the existing size (2) at non-singleton dimension 0. Target sizes: [1, 3, 384, 384]. Tensor sizes: [2, 3, 384, 384]
@wanmei002 commented on GitHub (Mar 4, 2025):
我也遇到了相同的问题
@hzhj66 commented on GitHub (Mar 4, 2025):
同样的问题
File /jupyter_data/Janus/janus/models/processing_vlm.py:403, in VLChatProcessor.batchify(self, prepare_list)
400 batched_images_seq_mask[i, -seq_len:] = input_ids == self.image_id
402 if n_image > 0:
--> 403 batched_pixel_values[i, :n_image] = prepare.pixel_values
404 for j, n_image_tokens in enumerate(prepare.num_image_tokens):
405 batched_images_emb_mask[i, j, :n_image_tokens] = True
RuntimeError: The expanded size of the tensor (1) must match the existing size (40) at non-singleton dimension 0. Target sizes: [1, 3, 384, 384]. Tensor sizes: [40, 3, 384, 384]
@HangyuRan commented on GitHub (Mar 30, 2025):
You can try adding the same number of <image_placeholder> as images in User's content.