You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/mnt/gpt/anaconda3/envs/py310/bin/magic-pdf", line 8, in
sys.exit(cli())
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/click/core.py", line 1157, in call
return self.main(*args, **kwargs)
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/magic_pdf/cli/magicpdf.py", line 325, in pdf_command
do_parse(
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/magic_pdf/cli/magicpdf.py", line 111, in do_parse
pipe.pipe_analyze()
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/magic_pdf/pipe/UNIPipe.py", line 29, in pipe_analyze
self.model_list = doc_analyze(self.pdf_bytes, ocr=False)
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/magic_pdf/model/doc_analyze_by_custom_model.py", line 69, in doc_analyze
custom_model = CustomPEKModel(ocr=ocr, show_log=show_log, models_dir=local_models_dir, device=device)
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/magic_pdf/model/pdf_extract_kit.py", line 106, in init
self.mfd_model = mfd_model_init(str(os.path.join(models_dir, self.configs["weights"]["mfd"])))
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/magic_pdf/model/pdf_extract_kit.py", line 29, in mfd_model_init
mfd_model = YOLO(weight)
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/ultralytics/models/yolo/model.py", line 23, in init
super().init(model=model, task=task, verbose=verbose)
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/ultralytics/engine/model.py", line 149, in init
self._load(model, task=task)
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/ultralytics/engine/model.py", line 230, in _load
self.model, self.ckpt = attempt_load_one_weight(weights)
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/ultralytics/nn/tasks.py", line 855, in attempt_load_one_weight
ckpt, weight = torch_safe_load(weight) # load ckpt
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/ultralytics/nn/tasks.py", line 781, in torch_safe_load
ckpt = torch.load(file, map_location="cpu")
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/torch/serialization.py", line 1040, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/torch/serialization.py", line 1262, in _legacy_load
magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, 'v'.
Description of the bug | 错误描述
Traceback (most recent call last):
File "/mnt/gpt/anaconda3/envs/py310/bin/magic-pdf", line 8, in
sys.exit(cli())
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/click/core.py", line 1157, in call
return self.main(*args, **kwargs)
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/magic_pdf/cli/magicpdf.py", line 325, in pdf_command
do_parse(
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/magic_pdf/cli/magicpdf.py", line 111, in do_parse
pipe.pipe_analyze()
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/magic_pdf/pipe/UNIPipe.py", line 29, in pipe_analyze
self.model_list = doc_analyze(self.pdf_bytes, ocr=False)
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/magic_pdf/model/doc_analyze_by_custom_model.py", line 69, in doc_analyze
custom_model = CustomPEKModel(ocr=ocr, show_log=show_log, models_dir=local_models_dir, device=device)
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/magic_pdf/model/pdf_extract_kit.py", line 106, in init
self.mfd_model = mfd_model_init(str(os.path.join(models_dir, self.configs["weights"]["mfd"])))
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/magic_pdf/model/pdf_extract_kit.py", line 29, in mfd_model_init
mfd_model = YOLO(weight)
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/ultralytics/models/yolo/model.py", line 23, in init
super().init(model=model, task=task, verbose=verbose)
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/ultralytics/engine/model.py", line 149, in init
self._load(model, task=task)
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/ultralytics/engine/model.py", line 230, in _load
self.model, self.ckpt = attempt_load_one_weight(weights)
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/ultralytics/nn/tasks.py", line 855, in attempt_load_one_weight
ckpt, weight = torch_safe_load(weight) # load ckpt
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/ultralytics/nn/tasks.py", line 781, in torch_safe_load
ckpt = torch.load(file, map_location="cpu")
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/torch/serialization.py", line 1040, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "/mnt/gpt/anaconda3/envs/py310/lib/python3.10/site-packages/torch/serialization.py", line 1262, in _legacy_load
magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, 'v'.
How to reproduce the bug | 如何复现
magic-pdf pdf-command --pdf "test.pdf" --inside_model true
Operating system | 操作系统
Linux
Python version | Python 版本
3.10
Device mode | 设备模式
cpu
The text was updated successfully, but these errors were encountered: