Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jcui2001 opened this issue Sep 2, 2024 · 4 comments

Comments

@jcui2001
Copy link

jcui2001 commented Sep 2, 2024

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
Copy link
Contributor

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
Copy link
Author

jcui2001 commented Sep 7, 2024

Thank you!

@jcui2001 jcui2001 closed this as completed Sep 7, 2024
@adityanmuleva
Copy link

I am attempting to download the model as outlined in the Model Downloadsection. However, it appears that there are no models available from Wanderkid for PDF-Extract-Kit. For your reference, please check this link : https://www.modelscope.cn/models/wanderkid/PDF-Extract-Kit

@myhloli
Copy link
Collaborator

myhloli commented Oct 7, 2024

I am attempting to download the model as outlined in the Model Downloadsection. However, it appears that there are no models available from Wanderkid for PDF-Extract-Kit. For your reference, please check this link : https://www.modelscope.cn/models/wanderkid/PDF-Extract-Kit

moved to https://huggingface.co/opendatalab/PDF-Extract-Kit

or

https://www.modelscope.cn/models/opendatalab/PDF-Extract-Kit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants