Code Monkey home page Code Monkey logo

Comments (4)

javahook avatar javahook commented on July 30, 2024

RuntimeError Traceback (most recent call last)
/root/work/milvus/reverse_image_search/1_build_image_search_engine.ipynb Cell 12 line 2
1 # Display embedding result, no need for implementation
----> 2 p_display = p_embed.output('img_path', 'img', 'vec')
3 DataCollection(p_display('./test/goldfish/*.JPEG')).show()

File ~/anaconda3/envs/milvusenv/lib/python3.8/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 ~/anaconda3/envs/milvusenv/lib/python3.8/site-packages/towhee/runtime/runtime_pipeline.py:153, in RuntimePipeline.preload(self)
149 def preload(self):
150 """
151 Preload the operators.
152 """
--> 153 return _Graph(self._dag_repr.nodes, self._dag_repr.edges, self._operator_pool, self._thread_pool, TimeProfiler(False))

File ~/anaconda3/envs/milvusenv/lib/python3.8/site-packages/towhee/runtime/runtime_pipeline.py:67, in _Graph.init(self, nodes, edges, operator_pool, thread_pool, time_profiler, trace_edges)
65 self.features = None
66 self._time_profiler.record(Event.pipe_name, Event.pipe_in)
---> 67 self._initialize()
68 self._input_queue = self._data_queues[0]

File ~/anaconda3/envs/milvusenv/lib/python3.8/site-packages/towhee/runtime/runtime_pipeline.py:83, in _Graph._initialize(self)
81 node = create_node(self._nodes[name], self._operator_pool, in_queues, out_queues, self._time_profiler)
82 if not node.initialize():
---> 83 raise RuntimeError(node.err_msg)
84 self._node_runners.append(node)

RuntimeError: Node-image-embedding/timm-2 runs failed, error msg: Create image-embedding/timm-2 operator image-embedding/timm:main with args None and kws {'model_name': 'resnet50', 'device': None} failed, err: An error happened while trying to locate the file on the Hub and we cannot find the requested files in the local cache. Please check your connection and try again or make sure your Internet connection is on., Traceback (most recent call last):
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/urllib3/connection.py", line 203, in _new_conn
sock = connection.create_connection(
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/urllib3/util/connection.py", line 85, in create_connection
raise err
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/urllib3/util/connection.py", line 73, in create_connection
sock.connect(sa)
OSError: [Errno 101] Network is unreachable

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 790, in urlopen
response = self._make_request(
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 491, in _make_request
raise new_e
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request
self._validate_conn(conn)
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 1092, in _validate_conn
conn.connect()
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/urllib3/connection.py", line 611, in connect
self.sock = sock = self._new_conn()
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/urllib3/connection.py", line 218, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7fe7a11687c0>: Failed to establish a new connection: [Errno 101] Network is unreachable

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/requests/adapters.py", line 486, in send
resp = conn.urlopen(
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 844, in urlopen
retries = retries.increment(
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/urllib3/util/retry.py", line 515, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /timm/resnet50.a1_in1k/resolve/main/pytorch_model.bin (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fe7a11687c0>: Failed to establish a new connection: [Errno 101] Network is unreachable'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/huggingface_hub/file_download.py", line 1232, in hf_hub_download
metadata = get_hf_file_metadata(
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn
return fn(*args, **kwargs)
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/huggingface_hub/file_download.py", line 1599, in get_hf_file_metadata
r = _request_wrapper(
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/huggingface_hub/file_download.py", line 417, in _request_wrapper
response = _request_wrapper(
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/huggingface_hub/file_download.py", line 452, in _request_wrapper
return http_backoff(
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 258, in http_backoff
response = session.request(method=method, url=url, **kwargs)
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 63, in send
return super().send(request, *args, **kwargs)
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/requests/adapters.py", line 519, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: (MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /timm/resnet50.a1_in1k/resolve/main/pytorch_model.bin (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fe7a11687c0>: Failed to establish a new connection: [Errno 101] Network is unreachable'))"), '(Request ID: 7bca68b0-7fc4-45dc-a413-b295b49193e8)')

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/towhee/runtime/nodes/node.py", line 88, in initialize
self._op = self._op_pool.acquire_op(
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/towhee/runtime/operator_manager/operator_pool.py", line 106, in acquire_op
op = self._op_loader.load_operator(hub_op_id, op_args, op_kws, tag, latest)
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/towhee/runtime/operator_manager/operator_loader.py", line 154, in load_operator
op = factory(function, arg, kws, tag, latest)
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/towhee/runtime/operator_manager/operator_loader.py", line 137, in _load_operator_from_hub
return self._load_operator_from_path(path, function, arg, kws, tag)
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/towhee/runtime/operator_manager/operator_loader.py", line 125, in _load_operator_from_path
return self._instance_operator(op, arg, kws) if op is not None else None
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/towhee/runtime/operator_manager/operator_loader.py", line 163, in _instance_operator
return op(*arg, **kws) if kws is not None else op(*arg)
File "/root/.towhee/operators/image-embedding/timm/versions/main/init.py", line 19, in timm
return TimmImage(**kwargs)
File "/root/.towhee/operators/image-embedding/timm/versions/main/timm_image.py", line 97, in init
self.model = Model(
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/towhee/runtime/runtime_conf.py", line 88, in _decorated
return model(*args, **kwargs)
File "/root/.towhee/operators/image-embedding/timm/versions/main/timm_image.py", line 63, in init
self.model = create_model(model_name, pretrained=True, num_classes=num_classes)
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/timm/models/_factory.py", line 114, in create_model
model = create_fn(
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/timm/models/resnet.py", line 1283, in resnet50
return _create_resnet('resnet50', pretrained, **dict(model_args, **kwargs))
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/timm/models/resnet.py", line 547, in _create_resnet
return build_model_with_cfg(ResNet, variant, pretrained, **kwargs)
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/timm/models/_builder.py", line 393, in build_model_with_cfg
load_pretrained(
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/timm/models/_builder.py", line 186, in load_pretrained
state_dict = load_state_dict_from_hf(pretrained_loc)
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/timm/models/_hub.py", line 188, in load_state_dict_from_hf
cached_file = hf_hub_download(hf_model_id, filename=filename, revision=hf_revision)
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn
return fn(*args, **kwargs)
File "/root/anaconda3/envs/milvusenv/lib/python3.8/site-packages/huggingface_hub/file_download.py", line 1349, in hf_hub_download
raise LocalEntryNotFoundError(
huggingface_hub.utils._errors.LocalEntryNotFoundError: An error happened while trying to locate the file on the Hub and we cannot find the requested files in the local cache. Please check your connection and try again or make sure your Internet connection is on.

from examples.

junjiejiangjjj avatar junjiejiangjjj commented on July 30, 2024

It should be a network issue, you can try using timm's interface directly. https://huggingface.co/docs/timm/quickstart

from examples.

javahook avatar javahook commented on July 30, 2024

wget to confirm network to huggingface.co is ok.
image
but the error is always.
image

from examples.

meoqi avatar meoqi commented on July 30, 2024

运行【1_build_image_search_engine.ipynb】过程中 在【p_display = p_embed.output('img_path', 'img', 'vec')】出如下错误: huggingface_hub.utils._errors.LocalEntryNotFoundError ...

应该是下载模型出错,多次尝试多不行。确认网络没问题,手动能够访问huggingface.co。

手动下载后放在这个目录下,问题依旧。 .cache> huggingface > hub > models--timm--resnet50.a1 in1k>pytorch model.bin

请问最后是怎么解决的呀,我也放在这个目录下了,还是报错。

from examples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.