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

[Bug]: Embedding is failed for pipeline "'shiyu/img_object_embedding_pytorch_yolov5_resnet50'" #302

Closed
1 task done
binbinlv opened this issue Dec 2, 2021 · 4 comments
Assignees
Labels
stale triage/as-designed Indicates an issue is not a bug and works as designed

Comments

@binbinlv
Copy link
Contributor

binbinlv commented Dec 2, 2021

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Embedding is empty for pipeline "'shiyu/img_object_embedding_pytorch_yolov5_resnet50'"

>>> from towhee import pipeline
>>> from PIL import Image
>>> img_path = '/Users/binbin/towhee/docs/towhee_logo.png'
>>> embedding_pipeline = pipeline('shiyu/img_object_embedding_pytorch_yolov5_resnet50')
>>> embedding = embedding_pipeline(img_path)
Using cache found in /Users/binbin/.cache/torch/hub/ultralytics_yolov5_master
YOLOv5 🚀 2021-12-1 torch 1.10.0 CPU

Fusing layers...
Model Summary: 213 layers, 7225885 parameters, 0 gradients
Adding AutoShape...
/Users/binbin/Towhee_projects/towhee-test-env/lib/python3.8/site-packages/torch/autocast_mode.py:141: UserWarning: User provided device_type of 'cuda', but CUDA is not available. Disabling
  warnings.warn('User provided device_type of \'cuda\', but CUDA is not available. Disabling')
>>>
>>>
>>> embedding
[]

Expected Behavior

Embedding vector is created

Steps To Reproduce

from towhee import pipeline
from PIL import Image
img_path = '/Users/binbin/towhee/docs/towhee_logo.png'
embedding_pipeline = pipeline('shiyu/img_object_embedding_pytorch_yolov5_resnet50')
embedding = embedding_pipeline(img_path)

Environment

- Towhee version(e.g. v0.1.3 or 8b23a93):0.2.2
- OS(Ubuntu or CentOS): mac
- CPU/Memory: 
- GPU: 
- Others:

Anything else?

No response

@binbinlv
Copy link
Contributor Author

binbinlv commented Dec 2, 2021

Update:

using latest towhee version: 0.2.3.dev3

it reports "RuntimeError: Unkown error".

>>> from towhee import pipeline
>>> from PIL import Image
>>> img_path = '/Users/binbin/towhee/docs/towhee_logo.png'
>>> embedding_pipeline = pipeline('shiyu/img_object_embedding_pytorch_yolov5_resnet50')
>>> embedding = embedding_pipeline(img_path)
/Users/binbin/Towhee_projects/towhee-test-env/lib/python3.8/site-packages/torch/autocast_mode.py:141: UserWarning: User provided device_type of 'cuda', but CUDA is not available. Disabling
  warnings.warn('User provided device_type of \'cuda\', but CUDA is not available. Disabling')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/binbin/Towhee_projects/towhee-test-env/lib/python3.8/site-packages/towhee/__init__.py", line 73, in __call__
    out_df = self._pipeline(in_df)
  File "/Users/binbin/Towhee_projects/towhee-test-env/lib/python3.8/site-packages/towhee/engine/pipeline.py", line 91, in __call__
    return graph_ctx.result()
  File "/Users/binbin/Towhee_projects/towhee-test-env/lib/python3.8/site-packages/towhee/engine/graph_context.py", line 76, in result
    raise RuntimeError('Unkown error')
RuntimeError: Unkown error

@binbinlv binbinlv changed the title [Bug]: Embedding is empty for pipeline "'shiyu/img_object_embedding_pytorch_yolov5_resnet50'" [Bug]: Embedding is failed for pipeline "'shiyu/img_object_embedding_pytorch_yolov5_resnet50'" Dec 2, 2021
@shiyu22
Copy link
Contributor

shiyu22 commented Dec 2, 2021

This is an issue of exception handling in the Towhee framework. In the feature, we will add some specific exception types. Now they are all runtime exceptions. In the latter case without results, it will throw NoDataException.

BTW, Towhee will throw some error conditions through exceptions in v1.0. And the users for the pipeline can decide how to deal with the exception after catching the exception.

@binbinlv
Copy link
Contributor Author

binbinlv commented Dec 2, 2021

OK, and the error reported which is not specific and friendly is actually another issue.

This issue which I means is I want the logo image could be embedded successfully. But through discussion, this model is not supported this logo image, and which is not the pipeline issue.

And embedding is successfully when replacing a cat image, so close it.

Thanks.

@binbinlv binbinlv closed this as completed Dec 2, 2021
@fzliu fzliu self-assigned this Dec 3, 2021
@fzliu fzliu reopened this Dec 3, 2021
@stale
Copy link

stale bot commented Jan 2, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Rotten issues close after 30d of inactivity. Close the stale issues and pull requests after 7 days of inactivity. Reopen the issue with /reopen.

@stale stale bot added the stale label Jan 2, 2022
@stale stale bot closed this as completed Jan 9, 2022
@binbinlv binbinlv added the triage/as-designed Indicates an issue is not a bug and works as designed label Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale triage/as-designed Indicates an issue is not a bug and works as designed
Projects
None yet
Development

No branches or pull requests

3 participants