Closed chenjingcheng closed 10 months ago
可以试一下在得到model from_pretrained以后加上:
new_image_size = 128
from sat.model.official.vit_model import ViTProperty
old_prop = model.get_mixin("eva").model.vit.transformer.property
new_prop = ViTProperty(new_image_size, old_prop.patch_size, old_prop.pre_len, old_prop.post_len)
model.get_mixin("eva").model.vit.get_mixin("pos_embedding").reinit(property=new_prop)
args.eva_args["image_size"] = new_image_size
可以试一下在得到model from_pretrained以后加上:
new_image_size = 128 from sat.model.official.vit_model import ViTProperty old_prop = model.get_mixin("eva").model.vit.transformer.property new_prop = ViTProperty(new_image_size, old_prop.patch_size, old_prop.pre_len, old_prop.post_len) model.get_mixin("eva").model.vit.get_mixin("pos_embedding").reinit(property=new_prop) args.eva_args["image_size"] = new_image_size
好的,非常感谢!
可以试一下在得到model from_pretrained以后加上:
new_image_size = 128 from sat.model.official.vit_model import ViTProperty old_prop = model.get_mixin("eva").model.vit.transformer.property new_prop = ViTProperty(new_image_size, old_prop.patch_size, old_prop.pre_len, old_prop.post_len) model.get_mixin("eva").model.vit.get_mixin("pos_embedding").reinit(property=new_prop) args.eva_args["image_size"] = new_image_size
好的,非常感谢!
可以试一下在得到model from_pretrained以后加上:
new_image_size = 128 from sat.model.official.vit_model import ViTProperty old_prop = model.get_mixin("eva").model.vit.transformer.property new_prop = ViTProperty(new_image_size, old_prop.patch_size, old_prop.pre_len, old_prop.post_len) model.get_mixin("eva").model.vit.get_mixin("pos_embedding").reinit(property=new_prop) args.eva_args["image_size"] = new_image_size
您好,按照您的代码,我测试了,发现报错,log如下:
Traceback (most recent call last):
File "/home/aifont/disk4T/aiproject/visualGLM-6B/finetune_visualglm.py", line 184, in
new_image_size = [128, 128]
您好,非常感谢您的项目,由于我自己的图片不需要224尺寸,128或96的都可以满足。请问我用小于224的图片能进行finetune吗?需要修改相关代码吗?谢谢!