opendatalab / MinerU

A high-quality tool for convert PDF to Markdown and JSON.一站式开源高质量数据提取工具,将PDF转换成Markdown和JSON格式。
https://opendatalab.com/OpenSourceTools?tool=extract
GNU Affero General Public License v3.0
19.66k stars 1.4k forks source link

magic_pdf.tools.cli:parse_doc:96 - Error(s) in loading state_dict for UniMERModel: #807

Closed WangJianQ-0118 closed 1 month ago

WangJianQ-0118 commented 1 month ago

Description of the bug | 错误描述

CustomVisionEncoderDecoderModel init VariableUnimerNetModel init VariableUnimerNetPatchEmbeddings init VariableUnimerNetModel init VariableUnimerNetPatchEmbeddings init CustomMBartForCausalLM init CustomMBartDecoder init 2024-10-28 21:14:57.174 | ERROR | magic_pdf.tools.cli:parse_doc:96 - Error(s) in loading state_dict for UniMERModel: size mismatch for model.model.decoder.model.decoder.layers.0.self_attn.k_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.0.self_attn.k_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.0.self_attn.q_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.0.self_attn.q_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.0.encoder_attn.k_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.0.encoder_attn.k_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.0.encoder_attn.q_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.0.encoder_attn.q_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.1.self_attn.k_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.1.self_attn.k_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.1.self_attn.q_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.1.self_attn.q_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.1.encoder_attn.k_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.1.encoder_attn.k_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.1.encoder_attn.q_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.1.encoder_attn.q_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.2.self_attn.k_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.2.self_attn.k_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.2.self_attn.q_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.2.self_attn.q_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.2.encoder_attn.k_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.2.encoder_attn.k_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.2.encoder_attn.q_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.2.encoder_attn.q_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.3.self_attn.k_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.3.self_attn.k_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.3.self_attn.q_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.3.self_attn.q_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.3.encoder_attn.k_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.3.encoder_attn.k_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.3.encoder_attn.q_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.3.encoder_attn.q_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.4.self_attn.k_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.4.self_attn.k_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.4.self_attn.q_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.4.self_attn.q_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.4.encoder_attn.k_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.4.encoder_attn.k_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.4.encoder_attn.q_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.4.encoder_attn.q_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.5.self_attn.k_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.5.self_attn.k_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.5.self_attn.q_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.5.self_attn.q_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.5.encoder_attn.k_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.5.encoder_attn.k_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.5.encoder_attn.q_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.5.encoder_attn.q_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.6.self_attn.k_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.6.self_attn.k_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.6.self_attn.q_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.6.self_attn.q_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.6.encoder_attn.k_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.6.encoder_attn.k_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.6.encoder_attn.q_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.6.encoder_attn.q_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.7.self_attn.k_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.7.self_attn.k_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.7.self_attn.q_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.7.self_attn.q_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.7.encoder_attn.k_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.7.encoder_attn.k_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.7.encoder_attn.q_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.7.encoder_attn.q_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). Traceback (most recent call last):

File "/root/wangjianqiang/miniforge3/envs/pdf/bin/magic-pdf", line 8, in sys.exit(cli()) │ │ └ │ └ └ <module 'sys' (built-in)> File "/root/wangjianqiang/miniforge3/envs/pdf/lib/python3.10/site-packages/click/core.py", line 1157, in call return self.main(args, kwargs) │ │ │ └ {} │ │ └ () │ └ <function BaseCommand.main at 0x7f0be53567a0> └ File "/root/wangjianqiang/miniforge3/envs/pdf/lib/python3.10/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) │ │ └ <click.core.Context object at 0x7f0be5592e60> │ └ <function Command.invoke at 0x7f0be5357250> └ File "/root/wangjianqiang/miniforge3/envs/pdf/lib/python3.10/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, ctx.params) │ │ │ │ │ └ {'path': '/root/wangjianqiang/PDF/test2.pdf', 'output_dir': '/root/wangjianqiang/PDF/', 'method': 'auto', 'debug_able': False... │ │ │ │ └ <click.core.Context object at 0x7f0be5592e60> │ │ │ └ <function cli at 0x7f0a8a42cca0> │ │ └ │ └ <function Context.invoke at 0x7f0be5355fc0> └ <click.core.Context object at 0x7f0be5592e60> File "/root/wangjianqiang/miniforge3/envs/pdf/lib/python3.10/site-packages/click/core.py", line 783, in invoke return __callback(args, **kwargs) │ └ {'path': '/root/wangjianqiang/PDF/test2.pdf', 'output_dir': '/root/wangjianqiang/PDF/', 'method': 'auto', 'debug_able': False... └ () File "/root/wangjianqiang/miniforge3/envs/pdf/lib/python3.10/site-packages/magic_pdf/tools/cli.py", line 102, in cli parse_doc(path) │ └ '/root/wangjianqiang/PDF/test2.pdf' └ <function cli..parse_doc at 0x7f0be55c2560>

File "/root/wangjianqiang/miniforge3/envs/pdf/lib/python3.10/site-packages/magic_pdf/tools/cli.py", line 84, in parse_doc do_parse( └ <function do_parse at 0x7f0a8a42c430> File "/root/wangjianqiang/miniforge3/envs/pdf/lib/python3.10/site-packages/magic_pdf/tools/common.py", line 79, in do_parse pipe.pipe_analyze() │ └ <function UNIPipe.pipe_analyze at 0x7f0a8a42c5e0> └ <magic_pdf.pipe.UNIPipe.UNIPipe object at 0x7f0a8a410f10> File "/root/wangjianqiang/miniforge3/envs/pdf/lib/python3.10/site-packages/magic_pdf/pipe/UNIPipe.py", line 30, in pipe_analyze self.model_list = doc_analyze(self.pdf_bytes, ocr=False, │ │ │ │ └ b'%PDF-1.5\n%\x8f\n5 0 obj\n<< /Filter /FlateDecode /Length 586 >>\nstream\nx\xdamT\xcb\x8e\xe20\x10\xbc\xe7+\xbc\x07$\xe6\xc... │ │ │ └ <magic_pdf.pipe.UNIPipe.UNIPipe object at 0x7f0a8a410f10> │ │ └ <function doc_analyze at 0x7f0b3f03b5b0> │ └ [] └ <magic_pdf.pipe.UNIPipe.UNIPipe object at 0x7f0a8a410f10> File "/root/wangjianqiang/miniforge3/envs/pdf/lib/python3.10/site-packages/magic_pdf/model/doc_analyze_by_custom_model.py", line 110, in doc_analyze custom_model = model_manager.get_model(ocr, show_log) │ │ │ └ False │ │ └ False │ └ <function ModelSingleton.get_model at 0x7f0b3f03b520> └ <magic_pdf.model.doc_analyze_by_custom_model.ModelSingleton object at 0x7f0a89659120> File "/root/wangjianqiang/miniforge3/envs/pdf/lib/python3.10/site-packages/magic_pdf/model/doc_analyze_by_custom_model.py", line 63, in get_model self._models[key] = custom_model_init(ocr=ocr, show_log=show_log) │ │ │ │ │ └ False │ │ │ │ └ False │ │ │ └ <function custom_model_init at 0x7f0b3f03b400> │ │ └ (False, False) │ └ {} └ <magic_pdf.model.doc_analyze_by_custom_model.ModelSingleton object at 0x7f0a89659120> File "/root/wangjianqiang/miniforge3/envs/pdf/lib/python3.10/site-packages/magic_pdf/model/doc_analyze_by_custom_model.py", line 93, in custom_model_init custom_model = CustomPEKModel(model_input) │ └ {'ocr': False, 'show_log': False, 'models_dir': '/root/wangjianqiang/PDF/PDF-Extract-Kit/models', 'device': 'cpu', 'table_con... └ <class 'magic_pdf.model.pdf_extract_kit.CustomPEKModel'> File "/root/wangjianqiang/miniforge3/envs/pdf/lib/python3.10/site-packages/magic_pdf/model/pdf_extract_kit.py", line 207, in init self.mfr_model, self.mfr_transform = atom_model_manager.get_atom_model( │ │ │ └ <function AtomModelSingleton.get_atom_model at 0x7f09a491bac0> │ │ └ <magic_pdf.model.pdf_extract_kit.AtomModelSingleton object at 0x7f09a4af79a0> │ └ <magic_pdf.model.pdf_extract_kit.CustomPEKModel object at 0x7f0a896591e0> └ <magic_pdf.model.pdf_extract_kit.CustomPEKModel object at 0x7f0a896591e0> File "/root/wangjianqiang/miniforge3/envs/pdf/lib/python3.10/site-packages/magic_pdf/model/pdf_extract_kit.py", line 112, in get_atom_model self._models[atom_model_name] = atom_model_init(model_name=atom_model_name, kwargs) │ │ │ │ │ └ {'mfr_weight_dir': '/root/wangjianqiang/PDF/PDF-Extract-Kit/models/MFR/UniMERNet', 'mfr_cfg_path': '/root/wangjianqiang/minif... │ │ │ │ └ 'mfr' │ │ │ └ <function atom_model_init at 0x7f09a491b7f0> │ │ └ 'mfr' │ └ {'mfd': YOLO( │ (model): DetectionModel( │ (model): Sequential( │ (0): Conv( │ (conv): Conv2d(3, 64, kernel_size=... └ <magic_pdf.model.pdf_extract_kit.AtomModelSingleton object at 0x7f09a4af79a0> File "/root/wangjianqiang/miniforge3/envs/pdf/lib/python3.10/site-packages/magic_pdf/model/pdf_extract_kit.py", line 129, in atom_model_init atom_model = mfr_model_init( └ <function mfr_model_init at 0x7f09a491b640> File "/root/wangjianqiang/miniforge3/envs/pdf/lib/python3.10/site-packages/magic_pdf/model/pdf_extract_kit.py", line 65, in mfr_model_init model = task.build_model(cfg) │ │ └ <unimernet.common.config.Config object at 0x7f09a469fd00> │ └ <function BaseTask.build_model at 0x7f09c6619240> └ <unimernet.tasks.unimernet_train.UniMERNet_Train object at 0x7f09a467f1c0> File "/root/wangjianqiang/miniforge3/envs/pdf/lib/python3.10/site-packages/unimernet/tasks/base_task.py", line 33, in build_model return model_cls.from_config(model_config) │ │ └ {'arch': 'unimernet', 'load_finetuned': False, 'load_pretrained': True, 'pretrained': '/root/wangjianqiang/PDF/PDF-Extract-Ki... │ └ <classmethod(<function UniMERModel.from_config at 0x7f09c67763b0>)> └ <class 'unimernet.models.unimernet.unimernet.UniMERModel'> File "/root/wangjianqiang/miniforge3/envs/pdf/lib/python3.10/site-packages/unimernet/models/unimernet/unimernet.py", line 108, in from_config model.load_checkpoint_from_config(cfg) │ │ └ {'arch': 'unimernet', 'load_finetuned': False, 'load_pretrained': True, 'pretrained': '/root/wangjianqiang/PDF/PDF-Extract-Ki... │ └ <function BaseModel.load_checkpoint_from_config at 0x7f09c75631c0> └ UniMERModel( (model): DonutEncoderDecoder( (model): CustomVisionEncoderDecoderModel( (encoder): VariableUnimerNet... File "/root/wangjianqiang/miniforge3/envs/pdf/lib/python3.10/site-packages/unimernet/models/base_model.py", line 97, in load_checkpoint_from_config self.load_from_pretrained(url_or_filename=pretrain_path, **kwargs) │ │ │ └ {} │ │ └ '/root/wangjianqiang/PDF/PDF-Extract-Kit/models/MFR/UniMERNet/pytorch_model.bin' │ └ <function Blip2Base.load_from_pretrained at 0x7f09c67bf1c0> └ UniMERModel( (model): DonutEncoderDecoder( (model): CustomVisionEncoderDecoderModel( (encoder): VariableUnimerNet... File "/root/wangjianqiang/miniforge3/envs/pdf/lib/python3.10/site-packages/unimernet/models/blip2_models/blip2.py", line 102, in load_from_pretrained msg = self.load_state_dict(state_dict, strict=False) │ │ └ OrderedDict([('model.model.encoder.embeddings.patch_embeddings.projection.weight', tensor([[[[ 0.0341, 0.0702, -0.0472, -0.0... │ └ <function Module.load_state_dict at 0x7f0a89551360> └ UniMERModel( (model): DonutEncoderDecoder( (model): CustomVisionEncoderDecoderModel( (encoder): VariableUnimerNet... File "/root/wangjianqiang/miniforge3/envs/pdf/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2189, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(

RuntimeError: Error(s) in loading state_dict for UniMERModel: size mismatch for model.model.decoder.model.decoder.layers.0.self_attn.k_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.0.self_attn.k_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.0.self_attn.q_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.0.self_attn.q_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.0.encoder_attn.k_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.0.encoder_attn.k_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.0.encoder_attn.q_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.0.encoder_attn.q_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.1.self_attn.k_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.1.self_attn.k_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.1.self_attn.q_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.1.self_attn.q_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.1.encoder_attn.k_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.1.encoder_attn.k_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.1.encoder_attn.q_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.1.encoder_attn.q_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.2.self_attn.k_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.2.self_attn.k_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.2.self_attn.q_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.2.self_attn.q_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.2.encoder_attn.k_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.2.encoder_attn.k_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.2.encoder_attn.q_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.2.encoder_attn.q_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.3.self_attn.k_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.3.self_attn.k_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.3.self_attn.q_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.3.self_attn.q_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.3.encoder_attn.k_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.3.encoder_attn.k_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.3.encoder_attn.q_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.3.encoder_attn.q_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.4.self_attn.k_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.4.self_attn.k_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.4.self_attn.q_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.4.self_attn.q_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.4.encoder_attn.k_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.4.encoder_attn.k_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.4.encoder_attn.q_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.4.encoder_attn.q_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.5.self_attn.k_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.5.self_attn.k_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.5.self_attn.q_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.5.self_attn.q_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.5.encoder_attn.k_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.5.encoder_attn.k_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.5.encoder_attn.q_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.5.encoder_attn.q_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.6.self_attn.k_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.6.self_attn.k_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.6.self_attn.q_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.6.self_attn.q_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.6.encoder_attn.k_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.6.encoder_attn.k_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.6.encoder_attn.q_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.6.encoder_attn.q_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.7.self_attn.k_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.7.self_attn.k_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.7.self_attn.q_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.7.self_attn.q_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.7.encoder_attn.k_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.7.encoder_attn.k_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for model.model.decoder.model.decoder.layers.7.encoder_attn.q_proj.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). size mismatch for model.model.decoder.model.decoder.layers.7.encoder_attn.q_proj.bias: copying a param with shape torch.Size([1024]) from checkpoint, the shape in current model is torch.Size([512]).

How to reproduce the bug | 如何复现

从hf下载的模型

Operating system | 操作系统

Linux

Python version | Python 版本

3.10

Software version | 软件版本 (magic-pdf --version)

0.8.x

Device mode | 设备模式

cpu

myhloli commented 1 month ago

magic-pdf 0.8.1适配的unimernet为0.1.6,最新版的unimernet为0.2.1需要配合magic-pdf0.9以上版本使用