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

RuntimeError: Loading operator with error:Load operator failed #236

Open
vig720 opened this issue Sep 8, 2023 · 5 comments
Open

RuntimeError: Loading operator with error:Load operator failed #236

vig720 opened this issue Sep 8, 2023 · 5 comments

Comments

@vig720
Copy link

vig720 commented Sep 8, 2023

Hello Everyone,
I am new to using Towhee, I am trying to run a basic code provided in their user guide

I am trying to run this code

`from towhee import ops, pipe, DataCollection

p = (
pipe.input('file_name')
.map('file_name', 'img', ops.image_decode.cv2())
.map('img', 'vec', ops.image_text_embedding.clip(model_name='clip_vit_base_patch32', modality='image'))
.map('vec', 'vec', ops.towhee.np_normalize())
.map(('vec', 'file_name'), (), ops.ann_insert.faiss_index('./faiss', 512))
.output()
)

for f_name in ['https://raw.githubusercontent.com/towhee-io/towhee/main/assets/dog1.png',
'https://raw.githubusercontent.com/towhee-io/towhee/main/assets/dog2.png',
'https://raw.githubusercontent.com/towhee-io/towhee/main/assets/dog3.png']:
p(f_name)

p.flush()

search image by text

decode = ops.image_decode.cv2('rgb')
p = (
pipe.input('text')
.map('text', 'vec', ops.image_text_embedding.clip(model_name='clip_vit_base_patch32', modality='text'))
.map('vec', 'vec', ops.towhee.np_normalize())
# faiss op result format: [[id, score, [file_name], ...]
.map('vec', 'row', ops.ann_search.faiss_index('./faiss', 3))
.map('row', 'images', lambda x: [decode(item[2][0]) for item in x])
.output('text', 'images')
)

DataCollection(p('a cat')).show()`

But I am getting this error

`RuntimeError Traceback (most recent call last)
Cell In[1], line 9
1 from towhee import ops, pipe, DataCollection
2 # create image embeddings and build index
3 p = (
4 pipe.input('file_name')
5 .map('file_name', 'img', ops.image_decode.cv2())
6 .map('img', 'vec', ops.image_text_embedding.clip(model_name='clip_vit_base_patch32', modality='image'))
7 .map('vec', 'vec', ops.towhee.np_normalize())
8 .map(('vec', 'file_name'), (), ops.ann_insert.faiss_index('[./faiss], 512))
----> 9 .output()
10 )
12 for f_name in ['https://raw.githubusercontent.com/towhee-io/towhee/main/assets/dog1.png',
13 'https://raw.githubusercontent.com/towhee-io/towhee/main/assets/dog2.png',
14 'https://raw.githubusercontent.com/towhee-io/towhee/main/assets/dog3.png']:
15 p(f_name)

File c:\Anaconda3\envs\py310\lib\site-packages\towhee\runtime\pipeline.py:101, in Pipeline.output(self, *output_schema)
98 dag_dict[self._clo_node]['next_nodes'].append(uid)
100 run_pipe = RuntimePipeline(dag_dict)
--> 101 run_pipe.preload()
102 return run_pipe

File c:\Anaconda3\envs\py310\lib\site-packages\towhee\runtime\runtime_pipeline.py:153, in RuntimePipeline.preload(self)
...
op = self._op_loader.load_operator(hub_op_id, op_args, op_kws, tag, latest)
File "c:\Anaconda3\envs\py310\lib\site-packages\towhee\runtime\operator_manager\operator_loader.py", line 158, in load_operator
raise RuntimeError('Load operator failed')
RuntimeError: Load operator failed`

Can some one let me know what is wrong

@junjiejiangjjj
Copy link
Contributor

Any detail logs?

@vig720
Copy link
Author

vig720 commented Sep 13, 2023

2023-09-08 11:24:23,074 - 19692 - operator_loader.py-operator_loader:134 - ERROR: [WinError 1314] A required privilege is not held by the client: '[C:\\Users\\.towhee\\operators\\image-decode\\cv2\\files\\ad2c20794adb0781ec953359ff6273ab55b73377](file:https:///C:https://Users//.towhee//operators//image-decode//cv2//files//ad2c20794adb0781ec953359ff6273ab55b73377)' -> '[C:\\Users\\.towhee\\operators\\image-decode\\cv2\\tmpn90651ms\\.gitattributes](file:https:///C:https://Users//.towhee//operators//image-decode//cv2//tmpn90651ms//.gitattributes)', Traceback (most recent call last):

It is saying I don't have required privilege,

do I need Admin privileges to install it

@junjiejiangjjj
Copy link
Contributor

@vig720
Copy link
Author

vig720 commented Sep 13, 2023

I tried this, but I can't do this. My system admin blocks it. Is there any other way

@Sarfaraz021
Copy link

yes follow this tut https://youtu.be/n_mmsnZ9BVE?si=xQQ7sKN8P-vCzDUk

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