LISA
LISA copied to clipboard
AttributeError: 'LISAForCausalLM' object has no attribute 'ce_loss_weight'
Hi, I'm trying to train the LISA-7B while stuck with this error:
AttributeError: 'LISAForCausalLM' object has no attribute 'ce_loss_weight'
This is because of the following codes in model/LISA.py:
if not hasattr(config, "train_mask_decoder"):
config.mm_use_im_start_end = kwargs.pop("use_mm_start_end", True)
config.mm_vision_tower = kwargs.get(
"vision_tower", "openai/clip-vit-large-patch14"
)
self.ce_loss_weight = kwargs.pop("ce_loss_weight", None)
self.dice_loss_weight = kwargs.pop("dice_loss_weight", None)
self.bce_loss_weight = kwargs.pop("bce_loss_weight", None)
else:
config.mm_vision_tower = config.vision_tower
Since in config, train_mask_decoder is set to True, so self.ce_loss_weight is not initialized. Is this a bug of the training code or did I make any mistake with the training config?
Thanks.
Hi, do you want to train further with LISA as the base model?
Hi, do you want to train further with LISA as the base model?
Hi, thanks for the reply.
Yes, I tried to run train_ds.py
and met the issue.
I tried to solve it by changing if not hasattr(config, "train_mask_decoder"):
to if hasattr(config, "train_mask_decoder"):
, and afterward I could run the code. However, I still don't know why the original code had that issue.
Hi, thanks for the reply. Yes, I tried to run
train_ds.py
and met the issue. I tried to solve it by changingif not hasattr(config, "train_mask_decoder"):
toif hasattr(config, "train_mask_decoder"):
, and afterward I could run the code. However, I still don't know why the original code had that issue.
Thanks a lot, I ran into the same problem and solved it by your method.