MinerU icon indicating copy to clipboard operation
MinerU copied to clipboard

AttributeError: 'CustomMBartDecoder' object has no attribute 'embed_scale'

Open Akhilesh-pandey1 opened this issue 1 year ago • 1 comments

[07/21 22:09:19 d2.checkpoint.detection_checkpoint]: [DetectionCheckpointer] Loa ding from D:\github_project\backend_code_generation\models\Layout/model_final.pth ... [07/21 22:09:19 fvcore.common.checkpoint]: [Checkpointer] Loading from d:\github_project\backend_code_generation\models\Layout/model_final.pth ... 2024-07-21 22:09:20.946 | INFO | magic_pdf.model.pdf_extract_kit:init:125 - DocAnalysis init done! 2024-07-21 22:09:20.950 | INFO | magic_pdf.model.doc_analyze_by_custom_model:custom_model_init:90 - model init cost: 44.55924439430237 2024-07-21 22:09:59.858 | INFO | magic_pdf.model.pdf_extract_kit:call:136 - layout detection cost: 38.77

0: 1888x1472 1 embedding, 10787.5ms Speed: 52.9ms preprocess, 10787.5ms inference, 2.0ms postprocess per image at shape (1, 3, 1888, 1472) 2024-07-21 22:10:14.915 | ERROR | magic_pdf.cli.magicpdf:parse_doc:338 - 'CustomMBartDecoder' object has no attribute 'embed_scale' Traceback (most recent call last):

......................

File "D:\github_project\backend_code_generation\venv\lib\site-packages\unimernet\models\unimernet\encoder_decoder.py", line 235, in forward inputs_embeds = self.embed_tokens(input_ids) * self.embed_scale │ │ └ CustomMBartDecoder(
│ │ (embed_tokens): MBartScaledWordEmbedding(50000, 1024, padding_idx=1) │ │ (embed_positions): MBartLearnedP... │ └ tensor([[0]]) └ CustomMBartDecoder( (embed_tokens): MBartScaledWordEmbedding(50000, 1024, padding_idx=1) (embed_positions): MBartLearnedP...

File "D:\github_project\backend_code_generation\venv\lib\site-packages\torch\nn\modules\module.py", line 1709, in getattr raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'")

AttributeError: 'CustomMBartDecoder' object has no attribute 'embed_scale'

After model layout detection, this error arises. What could be the issue?

Akhilesh-pandey1 avatar Jul 21 '24 16:07 Akhilesh-pandey1

我把公式转换,公式检测这两个代码注视就能跑了 image

a273758104 avatar Jul 24 '24 02:07 a273758104

确保transformers是4.40.0 我发现高于这个版本会出现。我在Omniparse 替换marker引擎使用mineru实现的时候发现的。

QQQJoker avatar Oct 24 '24 06:10 QQQJoker