{"id":518,"date":"2025-10-22T14:37:29","date_gmt":"2025-10-22T06:37:29","guid":{"rendered":"https:\/\/my.di.cloudns.asia\/?p=518"},"modified":"2025-10-22T14:37:30","modified_gmt":"2025-10-22T06:37:30","slug":"mineru-1-3%e7%89%88%e6%9c%ac%e5%90%8e%ef%bc%8c-%e5%bc%ba%e7%83%88%e5%bb%ba%e8%ae%ae%e4%b8%8d%e8%a6%81%e5%9c%a8anaconda%e7%8e%af%e5%a2%83%e7%9b%b4%e6%8e%a5%e5%8d%87%e7%ba%a7%e8%bf%99%e4%b8%aa%e9%a1%b9","status":"publish","type":"post","link":"https:\/\/my.di.cloudns.asia\/index.php\/2025\/10\/22\/518.html","title":{"rendered":"MinerU 1.3\u7248\u672c\u540e\uff0c \u5f3a\u70c8\u5efa\u8bae\u4e0d\u8981\u5728anaconda\u73af\u5883\u76f4\u63a5\u5347\u7ea7\u8fd9\u4e2a\u9879\u76ee"},"content":{"rendered":"<p>MinerU 1.3\u7248\u672c\u540e\uff0c \u5f3a\u70c8\u5efa\u8bae\u4e0d\u8981\u5728anaconda\u73af\u5883\u76f4\u63a5\u5347\u7ea7\u8fd9\u4e2a\u9879\u76ee\uff0c\u4e24\u6b21\u9047\u5230\u6240\u6709\u7684python\u73af\u5883torch\u6027\u80fd\u6389\u4e8660%\uff0c\u800c\u4e14\u91cd\u65b0\u5b89\u88c5anaconda\u6216\u8005ROCm\u73af\u5883\u90fd\u65e0\u6cd5\u4fee\u590d\uff0c\u4e0d\u5f97\u5df2\u91cd\u88c5\u7cfb\u7edf\u3002\u5347\u7ea7\u8fd9\u4e2a\u9879\u76ee\u7684\u8bdd\uff0c\u8981\u4e48\u5220\u9664\u8fd9\u4e2a\u73af\u5883\u91cd\u65b0\u5b89\u88c5\uff0c\u8981\u4e48\u76f4\u63a5docker ROCm\/Pytorch\u4e0b\u8fd0\u884c\uff0c\u6211\u4e0d\u7406\u89e3\u4e3a\u4ec0\u4e48\u4f1a\u8fd9\u6837\uff0canaconda\u7684ROCm torch\u9694\u79bb\u4e86\u4e00\u4e2a\u5bc2\u5bde\uff0c\u6e05\u7406\u4e86\u6240\u6709\u6211\u77e5\u9053\u7684\u80fd\u6e05\u7406\u7684\uff0c\u90fd\u6ca1\u6709\u89e3\u51b3\u95ee\u9898\uff0c\u53cd\u590d\u786e\u8ba4\u5c31\u662f\u8fd9\u4e2a\u9879\u76ee\u5347\u7ea7\u5bfc\u81f4\u7684\u3002\u3002\u3002\u3002<br \/>\nAMD ROCm\u8fd0\u884c\u4e86\u4e00\u4e0b\uff0c\u5b8c\u5168\u53ef\u4ee5\u7528\uff0c\u975e\u5e38\u6b63\u5e38\u3002<\/p>\n<pre><code>pip install -U magic-pdf[full] --extra-index-url https:\/\/wheels.myhloli.com<\/code><\/pre>\n<p>\u7136\u540e\u628a\u5b83\u9ed8\u8ba4\u5b89\u88c5\u7684\u4ec0\u4e48torch\uff0cnvidia*XXX \u5378\u8f7d\u4e86\u5c31\u884c\u4e86\uff0c\u5360\u5730\u65b9\u3002 \u5b89\u88c5rocm\u7684torch\u548connxruntime-rocm\u3002\u7248\u672c\u968f\u610f\uff0c\u7528torch 2.8.0\u90fd\u6ca1\u95ee\u9898\uff0connxruntime-rocm\u662f\u4e0d\u662f\u5fc5\u987b\u7684\u6211\u6ca1\u6765\u5f97\u53ca\u786e\u8ba4\uff0c\u4e60\u60ef\u6027\u770b\u5230onnxruntime\u6a21\u578b\u7684\u76f4\u63a5\u52a0\u4e0a\u4e86\u8fd9\u4e2a\u3002\u5df2\u7ecf\u786e\u8ba4\uff0connxruntime-rocm\u975e\u5fc5\u987b\u3002\u56e0\u4e3aRapidtable \u4f5c\u8005\u53ea\u8bc6\u522bcuda\u7684onnxruntime\u6b63\u5728\u5c1d\u8bd5\u4fee\u6539\uff0c\u6709\u4e00\u70b9bug\uff0ctable\u8bc6\u522b\u540e\u7684ocr\u5012\u662f\u5df2\u7ecf\u81ea\u5df1\u6210\u529f\u6362\u6210torch\u4e86\u3002<br \/>\nPS\u53e6\u5916\u4e00\u4e2aultimatevocalremovergui\u97f3\u9891\u5904\u7406\u9879\u76ee\u540c\u7406\u4e5f\u53ef\u4ee5\u8fd9\u6837\u76f4\u63a5\u7528\uff0c\u5957\u7528cuda\u5b8c\u7f8e\u3002<\/p>\n<pre><code>#\u4e3a\u4e86\u65b9\u4fbf\u5378\u8f7d\u5305\uff0c\u6211\u76f4\u63a5\u8d34\u51fa\u6765\npip uninstall torch nvidia-cublas-cu12 nvidia-cuda-cupti-cu12 nvidia-cuda-nvrtc-cu12 nvidia-cuda-runtime-cu12 nvidia-cudnn-cu12 nvidia-cufft-cu12 nvidia-curand-cu12 nvidia-cusolver-cu12 nvidia-cusparse-cu12 nvidia-nccl-cu12 nvidia-nvjitlink-cu12 nvidia-nvtx-cu12\n#\u6211\u7528\u7684ROCm 6.3.4\uff0c\u6839\u636e\u81ea\u5df1\u7684\u7248\u672c\u6539\u4e00\u4e0b\u5c31\u884c\uff0ctorchaudio \u53ef\u4ee5\u5220\u9664\uff0c\u8fd9\u4e2a\u9879\u76ee\u7528\u4e0d\u5230\u3002\npip3 install --pre torch torchvision torchaudio --index-url https:\/\/download.pytorch.org\/whl\/nightly\/rocm6.3\n#onnxruntime GPU\u4f7f\u7528\uff0c\u975e\u5fc5\u987b\uff0c\u53ef\u4ee5\u5ffd\u7565\npip uninstall onnxruntime onnxruntime-rocm\npip3 install onnxruntime-rocm -f https:\/\/repo.radeon.com\/rocm\/manylinux\/rocm-rel-6.3.4\/<\/code><\/pre>\n<p>paddlepaddle\u8fd9\u73a9\u610f\u53ea\u652f\u6301ROCm 4.0\u7684\u53e4\u65e9\u671f\u7248\u672c\uff0c\u4e5f\u57fa\u672c\u6ca1\u4eba\u7ef4\u62a4ROCm\u7248\u4e86\uff08\u4ec0\u4e48\u5176\u4ed6\u7248\u672c\u90fd\u6709\uff0cROCm\u7248\u6ca1\u6709\uff0c\u65e0\u8bdd\u53ef\u8bf4\uff0c\u4e0d\u6127\u662f\u767e\u5ea6\uff09\u3002\u7f16\u8bd1\u8c03\u8bd5\u4e86\u4e00\u4e0b\uff0c\u5931\u8d25\uff0c\u5df2\u7ecf\u653e\u5f03\u3002\u7528\u9ed8\u8ba4CPU\u7248\u7684\u5c31\u8fd9\u6837\u5427\u3002<\/p>\n<p>\u8fd9\u4e2a\u9879\u76ee\u7684magic-pdf.json\u653e\u5728\uff5e\u76ee\u5f55\u4e0b\uff0c\u5f3a\u8feb\u75c7\u60a3\u8005\u96be\u4ee5\u63a5\u53d7\uff0c\u975e\u5e38\u4e0d\u9002\u3002\u4fee\u6539\u65b9\u6cd5\u5982\u4e0b\uff0c<br \/>\n\u4e0b\u8f7d\u6a21\u578b\u65f6\uff0cdownload_models_hf.py \u6216\u8005 download_models_hf.py \u4e2dhome_dir = os.path.expanduser(&#8216;~&#8217;)<br \/>\n\u6539\u4e3a\u4f60\u60f3\u653e\u5230\u7684\u4f4d\u7f6e\uff0c\u7136\u540e\u8fd9\u73a9\u610f\u5c45\u7136\u6ca1\u6709\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\uff0c\u8fd0\u884c\u7684\u6587\u4ef6\u8fd8\u5f97\u6539\u4e00\u4e0b\uff0c\u6211\u7684\u4f4d\u7f6e\u5982\u4e0b\uff0c\u4e0d\u662f\u7528anaconda\u7684\u53ef\u4ee5\u6839\u636e\u62a5\u9519\u627e\u4f4d\u7f6e.<\/p>\n<pre><code>~\/anaconda3\/envs\/mineru\/lib\/python3.10\/site-packages\/magic_pdf\/libs\/config_reader.py<\/code><\/pre>\n<p>19\u884chome_dir = os.path.expanduser(&#8216;~&#8217;)\u9700\u8981\u4fee\u6539<\/p>\n<h1>\u5b98\u65b9\u7684\u65b9\u6cd5\u4e3aexport MINERU_TOOLS_CONFIG_JSON=new_magic_pdf.json\uff0c\u4fee\u6539\u4f4d\u7f6e<\/h1>\n<p>\u7136\u540e\u6b63\u5e38magic-pdf.json\u4e2dcpu\u6539\u4e3acuda\u5c31\u53ef\u4ee5\u4f7f\u7528AMD GPU ROCm\u52a0\u901f\u4e86\u3002<\/p>\n<pre><code>magic-pdf -p {some_pdf} -o {some_output_dir} -m auto<\/code><\/pre>\n<h1>\u4f7f\u7528\u524d\u52a0\u4e0aexport MIOPEN_LOG_LEVEL=3\u5c4f\u853d\u6389warming\u53ef\u4ee5\u52a0\u5feb\u5904\u7406\u901f\u5ea6\uff0cAMD MIopen \u8001warming\u4e86<\/h1>\n<h1>7900xtx\u8fd0\u884c\uff0cPDF \u9875\u9762\u5904\u7406\u7684\u90e8\u5206\u53ef\u4ee5\u52a0\u901f\uff0c200-300\u591a\u74e6\u529f\u7387\u4e4b\u95f4\uff0c\u89e3\u6790\u4e86\u4e00\u4e2a\u8bba\u6587\u8bd5\u4e86\u4e00\u4e0b\u3002<\/h1>\n<h1>Ubuntu \u8865\u5145\u5b89\u88c5\u4e86\u4e00\u4e2aapt \u5305\uff0csudo apt install ccache\u3002\u4e0d\u88c5\u4e5f\u4e0d\u5f71\u54cd\u8fd0\u884c\u3002<\/h1>\n<p>OCR\u5982\u679c\u4ee5\u540e\u4e0d\u4f7f\u7528PaddleOCR\uff0ctorch rapidocr\u5b9e\u88c5\uff0c\u90a3\u4e48\u6211\u89c9\u5f97ROCm\u5b8c\u5168\u6ca1\u95ee\u9898\uff0c\u751a\u81f3\u90fd\u4e0d\u9700\u8981\u6539\u4ee3\u7801\uff0c\u73af\u5883\u4f9d\u8d56\u6539\u4e00\u4e0b\u5c31\u884c\u4e86\u3002\u4ece\u8bc6\u522b\u7ed3\u679c\u770b\uff0ctable\u7684onnxruntime cpu\u6267\u884c\u7684\uff0c5\u5f20\u8868\u65f6\u95f4\u592a\u957f\u4e86\uff0c\u5728\u5c1d\u8bd5\u7ed9\u4ed6\u6539\u4e86<\/p>\n<p>\u4ee5\u4e00\u4e2a14\u9762\u7684\u5c0f\u8bba\u6587\u5c55\u793a\uff0ccuda\uff0ctime: 25.73, speed: 0.54 pages\/second\uff1a<\/p>\n<pre><code>magic-pdf -p Optimum.pdf -o output -m auto\nimport tensorrt_llm failed, if do not use tensorrt, ignore this message\nimport lmdeploy failed, if do not use lmdeploy, ignore this message\n2025-03-27 17:19:18.496 | INFO | magic_pdf.data.dataset:init:156 - lang: None\n2025-03-27 17:19:22.283 | INFO | magic_pdf.libs.pdf_check:detect_invalid_chars:67 - cid_count: 40, text_len: 39995, cid_chars_radio: 0.0010065678552555425\n2025-03-27 17:19:22.285 | INFO | magic_pdf.model.pdf_extract_kit:init:78 - DocAnalysis init, this may take some times, layout_model: doclayout_yolo, apply_formula: True, apply_ocr: False, apply_table: True, table_model: rapid_table, lang: None\n2025-03-27 17:19:22.285 | INFO | magic_pdf.model.pdf_extract_kit:init:92 - using device: cuda\n2025-03-27 17:19:22.285 | INFO | magic_pdf.model.pdf_extract_kit:init:96 - using models_dir: \/home\/XXX\/.cache\/modelscope\/hub\/models\/opendatalab\/PDF-Extract-Kit-1___0\/models\nCustomVisionEncoderDecoderModel init\nVariableUnimerNetModel init\nVariableUnimerNetPatchEmbeddings init\nVariableUnimerNetModel init\nVariableUnimerNetPatchEmbeddings init\nCustomMBartForCausalLM init\nCustomMBartDecoder init\n2025-03-27 17:19:29,045 - DownloadModel - DEBUG: \/home\/XXX\/anaconda3\/envs\/mineru\/lib\/python3.10\/site-packages\/rapid_table\/models\/slanet-plus.onnx already exists\n[2025-03-27 17:19:29,045] [ DEBUG] download_model.py:34 - \/home\/XXX\/anaconda3\/envs\/mineru\/lib\/python3.10\/site-packages\/rapid_table\/models\/slanet-plus.onnx already exists\nE0327 17:19:29.218801 735058 analysis_config.cc:169] Please use PaddlePaddle with GPU version.\nE0327 17:19:29.337440 735058 analysis_config.cc:169] Please use PaddlePaddle with GPU version.\nE0327 17:19:29.427906 735058 analysis_config.cc:169] Please use PaddlePaddle with GPU version.\n2025-03-27 17:19:29.523 | INFO | magic_pdf.model.pdf_extract_kit:init:174 - DocAnalysis init done!\n2025-03-27 17:19:29.523 | INFO | magic_pdf.model.doc_analyze_by_custom_model:custom_model_init:128 - model init cost: 7.2390546798706055\n2025-03-27 17:19:29.523 | INFO | magic_pdf.model.doc_analyze_by_custom_model:doc_analyze:180 - gpu_memory: 24 GB, batch_ratio: 8\n2025-03-27 17:19:38.659 | INFO | magic_pdf.model.batch_analyze:call:74 - layout time: 8.82, image num: 14\n2025-03-27 17:19:39.623 | INFO | magic_pdf.model.batch_analyze:call:85 - mfd time: 0.96, image num: 14\n2025-03-27 17:19:45.392 | INFO | magic_pdf.model.batch_analyze:call:100 - mfr time: 5.77, image num: 401\n2025-03-27 17:19:55.135 | INFO | magic_pdf.model.batch_analyze:call:195 - det time: 6.06, image num: 200\n2025-03-27 17:19:55.136 | INFO | magic_pdf.model.batch_analyze:call:197 - table time: 3.65, image num: 5\n2025-03-27 17:19:55.250 | INFO | magic_pdf.model.doc_analyze_by_custom_model:doc_analyze:235 - gc time: 0.11\n2025-03-27 17:19:55.251 | INFO | magic_pdf.model.doc_analyze_by_custom_model:doc_analyze:239 - doc analyze time: 25.73, speed: 0.54 pages\/second\n2025-03-27 17:19:55.425 | INFO | magic_pdf.pdf_parse_union_core_v2:pdf_parse_union:946 - page_id: 0, last_page_cost_time: 0.0\n2025-03-27 17:19:56.017 | INFO | magic_pdf.pdf_parse_union_core_v2:pdf_parse_union:946 - page_id: 1, last_page_cost_time: 0.59\n2025-03-27 17:19:56.210 | INFO | magic_pdf.pdf_parse_union_core_v2:pdf_parse_union:946 - page_id: 2, last_page_cost_time: 0.19\n2025-03-27 17:19:56.430 | INFO | magic_pdf.pdf_parse_union_core_v2:pdf_parse_union:946 - page_id: 3, last_page_cost_time: 0.22\n2025-03-27 17:19:56.618 | INFO | magic_pdf.pdf_parse_union_core_v2:pdf_parse_union:946 - page_id: 4, last_page_cost_time: 0.19\n2025-03-27 17:19:56.811 | INFO | magic_pdf.pdf_parse_union_core_v2:pdf_parse_union:946 - page_id: 5, last_page_cost_time: 0.19\n2025-03-27 17:19:57.056 | INFO | magic_pdf.pdf_parse_union_core_v2:pdf_parse_union:946 - page_id: 6, last_page_cost_time: 0.24\n2025-03-27 17:19:57.262 | INFO | magic_pdf.pdf_parse_union_core_v2:pdf_parse_union:946 - page_id: 7, last_page_cost_time: 0.21\n2025-03-27 17:19:57.439 | INFO | magic_pdf.pdf_parse_union_core_v2:pdf_parse_union:946 - page_id: 8, last_page_cost_time: 0.18\n2025-03-27 17:19:57.624 | INFO | magic_pdf.pdf_parse_union_core_v2:pdf_parse_union:946 - page_id: 9, last_page_cost_time: 0.19\n2025-03-27 17:19:57.784 | INFO | magic_pdf.pdf_parse_union_core_v2:pdf_parse_union:946 - page_id: 10, last_page_cost_time: 0.16\n2025-03-27 17:19:57.999 | INFO | magic_pdf.pdf_parse_union_core_v2:pdf_parse_union:946 - page_id: 11, last_page_cost_time: 0.22\n2025-03-27 17:19:58.189 | INFO | magic_pdf.pdf_parse_union_core_v2:pdf_parse_union:946 - page_id: 12, last_page_cost_time: 0.19\n2025-03-27 17:19:58.542 | INFO | magic_pdf.pdf_parse_union_core_v2:pdf_parse_union:946 - page_id: 13, last_page_cost_time: 0.35\n2025-03-27 17:20:06.300 | INFO | magic_pdf.tools.common:do_parse:242 - local output dir is XXX<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>MinerU 1.3\u7248\u672c\u540e\uff0c \u5f3a\u70c8\u5efa\u8bae\u4e0d\u8981\u5728anaconda\u73af\u5883\u76f4\u63a5\u5347\u7ea7\u8fd9\u4e2a\u9879\u76ee\uff0c\u4e24\u6b21\u9047\u5230\u6240\u6709\u7684python\u73af [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-518","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/my.di.cloudns.asia\/index.php\/wp-json\/wp\/v2\/posts\/518","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/my.di.cloudns.asia\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/my.di.cloudns.asia\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/my.di.cloudns.asia\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/my.di.cloudns.asia\/index.php\/wp-json\/wp\/v2\/comments?post=518"}],"version-history":[{"count":1,"href":"https:\/\/my.di.cloudns.asia\/index.php\/wp-json\/wp\/v2\/posts\/518\/revisions"}],"predecessor-version":[{"id":519,"href":"https:\/\/my.di.cloudns.asia\/index.php\/wp-json\/wp\/v2\/posts\/518\/revisions\/519"}],"wp:attachment":[{"href":"https:\/\/my.di.cloudns.asia\/index.php\/wp-json\/wp\/v2\/media?parent=518"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/my.di.cloudns.asia\/index.php\/wp-json\/wp\/v2\/categories?post=518"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/my.di.cloudns.asia\/index.php\/wp-json\/wp\/v2\/tags?post=518"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}