towhee-io / towhee

Towhee is a framework that is dedicated to making neural data processing pipelines simple and fast.
https://towhee.io
Apache License 2.0
3.21k stars 247 forks source link

[Bug]: argument of type 'WindowsPath' is not iterable #2655

Closed beichenlpl closed 1 year ago

beichenlpl commented 1 year ago

Is there an existing issue for this?

Current Behavior

When I run this code: AutoPipes.pipeline('sentence_embedding') report ERROR: argument of type 'WindowsPath' is not iterable

Expected Behavior

No response

Steps To Reproduce

1、enter 'python' in Terminal
2、enter this code:
   from towhee import AutoPipes
   p = AutoPipes.pipeline('sentence_embedding')
3、report ERROR:argument of type 'WindowsPath' is not iterable

Environment

- Towhee version 1.1.1
- OS: Windows 11
- CPU/Memory: 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz / 16GB
- GPU: Intel(R) Iris(R) Xe Graphics
- Others: none

Anything else?

No response

junjiejiangjjj commented 1 year ago

We can process this first according to this, and later we will release a new version to fix this problem. https://github.com/towhee-io/towhee/pull/2653

beichenlpl commented 1 year ago

ok,thanks

stale[bot] commented 1 year ago

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.

zhuwensi commented 2 months ago

TypeError: argument of type 'WindowsPath' is not iterable

This error still exists for towhee 1.1.3.

from towhee import AutoPipes

# get the built-in text_image_embedding pipeline
image_embedding = AutoPipes.pipeline('text_image_embedding')

# generate image embedding
embedding = image_embedding('./test1.png').get()

# batch generate image embeddings
embeddings = image_embedding.batch(['./test1.png', './test2.png'])
embeddings = [e.get() for e in embeddings]

Error stack is:

2024-08-30 09:46:27,302 - 23796 - operator_loader.py-operator_loader:134 - ERROR: argument of type 'WindowsPath' is not iterable, Traceback (most recent call last):
  File "C:\Users\wensi\anaconda3\envs\workspace\lib\site-packages\towhee\runtime\operator_manager\operator_loader.py", line 131, in _load_operator_from_hub
    path = get_operator(operator=function, tag=tag, latest=latest)
  File "C:\Users\wensi\anaconda3\envs\workspace\lib\site-packages\towhee\hub\__init__.py", line 23, in get_operator
    return _CACHE_MANAGER.get_operator(operator, tag, install_reqs, latest)
  File "C:\Users\wensi\anaconda3\envs\workspace\lib\site-packages\towhee\hub\cache_manager.py", line 97, in get_operator
    download_operator(author, repo, tag, download_path, install_reqs, latest)
  File "C:\Users\wensi\anaconda3\envs\workspace\lib\site-packages\towhee\hub\downloader.py", line 178, in download_operator
    subprocess.check_call([sys.executable, '-m', 'pip', 'install', '-r', fs.requirements])
  File "C:\Users\wensi\anaconda3\envs\workspace\lib\subprocess.py", line 358, in check_call
    retcode = call(*popenargs, **kwargs)
  File "C:\Users\wensi\anaconda3\envs\workspace\lib\subprocess.py", line 339, in call
    with Popen(*popenargs, **kwargs) as p:
  File "C:\Users\wensi\anaconda3\envs\workspace\lib\subprocess.py", line 800, in __init__
    restore_signals, start_new_session)
  File "C:\Users\wensi\anaconda3\envs\workspace\lib\subprocess.py", line 1148, in _execute_child
    args = list2cmdline(args)
  File "C:\Users\wensi\anaconda3\envs\workspace\lib\subprocess.py", line 555, in list2cmdline
    needquote = (" " in arg) or ("\t" in arg) or not arg
TypeError: argument of type 'WindowsPath' is not iterable