opendatalab / PDF-Extract-Kit

A Comprehensive Toolkit for High-Quality PDF Content Extraction
GNU Affero General Public License v3.0
4.71k stars 319 forks source link

FileNotFoundError: [Errno 2] No such file or directory: 'models/MFD/weights.pt' #104

Closed jcui2001 closed 1 week ago

jcui2001 commented 1 week ago

Hello,

I am trying to run the demo after performing the pre-configuration steps on Mac m-chip:

python pdf_extract.py --pdf demo/demo1.pdf

as per this document: https://github.com/opendatalab/PDF-Extract-Kit/blob/main/docs/Install_in_macOS_en.md

I am getting an error: FileNotFoundError: [Errno 2] No such file or directory: 'models/MFD/weights.pt'

Where is this weights.pt file? I don't see it in the main repo.

Thanks!!

FULL TRACEBACK: Namespace(pdf='demo/demo1.pdf', output='output', batch_size=128, vis=False, render=False) 2024-09-03 00:59:55 Started! Traceback (most recent call last): File "/Users/jeremycui/Documents/Code_Work/pdf_extract_foreclosures/PDF-Extract-Kit/pdf_extract.py", line 100, in mfd_model = mfd_model_init(model_configs['model_args']['mfd_weight']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jeremycui/Documents/Code_Work/pdf_extract_foreclosures/PDF-Extract-Kit/pdf_extract.py", line 32, in mfd_model_init mfd_model = YOLO(weight) ^^^^^^^^^^^^ File "/Users/jeremycui/anaconda3/envs/pek_venv/lib/python3.11/site-packages/ultralytics/models/yolo/model.py", line 23, in init super().init(model=model, task=task, verbose=verbose) File "/Users/jeremycui/anaconda3/envs/pek_venv/lib/python3.11/site-packages/ultralytics/engine/model.py", line 145, in init self._load(model, task=task) File "/Users/jeremycui/anaconda3/envs/pek_venv/lib/python3.11/site-packages/ultralytics/engine/model.py", line 297, in _load self.model, self.ckpt = attempt_load_one_weight(weights) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jeremycui/anaconda3/envs/pek_venv/lib/python3.11/site-packages/ultralytics/nn/tasks.py", line 857, in attempt_load_one_weight ckpt, weight = torch_safe_load(weight) # load ckpt ^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jeremycui/anaconda3/envs/pek_venv/lib/python3.11/site-packages/ultralytics/nn/tasks.py", line 784, in torch_safe_load ckpt = torch.load(file, map_location="cpu") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jeremycui/anaconda3/envs/pek_venv/lib/python3.11/site-packages/ultralytics/utils/patches.py", line 86, in torch_load return _torch_load(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jeremycui/anaconda3/envs/pek_venv/lib/python3.11/site-packages/torch/serialization.py", line 997, in load with _open_file_like(f, 'rb') as opened_file: ^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jeremycui/anaconda3/envs/pek_venv/lib/python3.11/site-packages/torch/serialization.py", line 444, in _open_file_like return _open_file(name_or_buffer, mode) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jeremycui/anaconda3/envs/pek_venv/lib/python3.11/site-packages/torch/serialization.py", line 425, in init super().init(open(name, mode)) ^^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: 'models/MFD/weights.pt'

jorgeolothar commented 1 week ago

At the end of the installation guide, there is a reference to the model download "Refer to Model Download to download the required model weights."

jcui2001 commented 1 week ago

Thank you!