lxtGH / OMG-Seg

OMG-LLaVA and OMG-Seg codebase [CVPR-24 and NeurIPS-24]
Other
1.32k stars 50 forks source link

GCG推理时无法批处理 #52

Open zhicong01 opened 2 months ago

zhicong01 commented 2 months ago

作者您好,我发现在我移植的gcg推理代码中无法实现批处理,具体如下: predict, seg_hidden_states = forward_model( batch_inputs, pixel_values, self.omg_tokenizer, self.omg_model, self.omg_llm, self.omg_projector_text2vision, self.omg_gen_config, self.omg_stop_criteria) 对于batch为4的图像输入,pixel_values包含四个元素,如下: image 但是predict, seg_hidden_statesg尺寸不对,是对应单图的尺寸,如下: image image

怀疑是调用代码的这一句有问题,当pixel_values为单个或多个元素的list时,mm['inputs_embeds']都为(1,68,4096)的向量 mm_inputs = prepare_inputs_labels_for_multimodal(llm=llm, input_ids=ids, pixel_values=pixel_values)