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

Update Setup Instructions #102

Open
aswad546 opened this issue Dec 6, 2024 · 4 comments
Open

Update Setup Instructions #102

aswad546 opened this issue Dec 6, 2024 · 4 comments

Comments

@aswad546
Copy link

aswad546 commented Dec 6, 2024

Hello,

Thank you for making this wonderful tool. I was attempting to set it up on my machine and it seems that the setup instructions are incomplete in the readme and vague. I am having trouble converting safe tensor files to pt. Could you please give more details so I can setup easier.

Thanks,
Aswad

@aswad546
Copy link
Author

aswad546 commented Dec 6, 2024

python weights/convert_safetensor_to_pt.py
usage: convert_safetensor_to_pt.py [-h] --weights_dir WEIGHTS_DIR
convert_safetensor_to_pt.py: error: the following arguments are required: --weights_dir

What directory is this expecting

@aswad546
Copy link
Author

aswad546 commented Dec 6, 2024

I believe the model_v1_5.pt file is to replace the best.pt file in the gradiodemo but after doing so I get the following error:

yolo_model = get_yolo_model(model_path='weights/icon_detect_v1_5/model_v1_5.pt')

This is my error running this file now:
Traceback (most recent call last):
File "/u1/a8tariq/Llama vision/OmniParser/gradio_demo.py", line 15, in
yolo_model = get_yolo_model(model_path='weights/icon_detect_v1_5/model_v1_5.pt')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/u1/a8tariq/Llama vision/OmniParser/utils.py", line 73, in get_yolo_model
model = YOLO(model_path)
^^^^^^^^^^^^^^^^
File "/u1/a8tariq/.conda/envs/vllm/lib/python3.12/site-packages/ultralytics/models/yolo/model.py", line 23, in init
super().init(model=model, task=task, verbose=verbose)
File "/u1/a8tariq/.conda/envs/vllm/lib/python3.12/site-packages/ultralytics/engine/model.py", line 142, in init
self._load(model, task=task)
File "/u1/a8tariq/.conda/envs/vllm/lib/python3.12/site-packages/ultralytics/engine/model.py", line 229, in _load
self.model, self.ckpt = attempt_load_one_weight(weights)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/u1/a8tariq/.conda/envs/vllm/lib/python3.12/site-packages/ultralytics/nn/tasks.py", line 788, in attempt_load_one_weight
ckpt, weight = torch_safe_load(weight) # load ckpt
^^^^^^^^^^^^^^^^^^^^^^^
File "/u1/a8tariq/.conda/envs/vllm/lib/python3.12/site-packages/ultralytics/nn/tasks.py", line 714, in torch_safe_load
ckpt = torch.load(file, map_location="cpu")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/u1/a8tariq/.conda/envs/vllm/lib/python3.12/site-packages/torch/serialization.py", line 1360, in load
return _load(
^^^^^^
File "/u1/a8tariq/.conda/envs/vllm/lib/python3.12/site-packages/torch/serialization.py", line 1848, in _load
result = unpickler.load()
^^^^^^^^^^^^^^^^
File "/u1/a8tariq/.conda/envs/vllm/lib/python3.12/site-packages/torch/serialization.py", line 1837, in find_class
return super().find_class(mod_name, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: Can't get attribute 'C3k2' on <module 'ultralytics.nn.modules.block' from '/u1/a8tariq/.conda/envs/vllm/lib/python3.12/site-packages/ultralytics/nn/modules/block.py'>

@arsh837
Copy link

arsh837 commented Dec 9, 2024

upgrading the ultralytics library solves this issue
pip install --upgrade ultralytics

@yadong-lu
Copy link
Collaborator

@aswad546 thanks for noting the error. I have updated the readme to accommodate the v1.5 ckpt. Please let me know if you have any issues. Thanks

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

3 participants