我正在尝试查询谷歌顶点 ai 匹配服务。我的实现灵感来自 https://github.com/GoogleCloudPlatform/vertex-ai-samples/blob/main/notebooks/community/matching_engine/matching_engine_for_indexing.ipynb 和 https://github.com/GoogleCloudPlatform/vertex- ai-samples/blob/main/notebooks/community/matching_engine/matching_engine_for_indexing.ipynb 我做了 VPC,我的索引、端点和网络都在同一个区域。如文档中所述,我还在 VPC 网络上旋转我的笔记本,但我遇到了以下错误。
_InactiveRpcError Traceback (most recent call last)
/tmp/ipykernel_1/3998271569.py in <module>
2 deployed_index_id="deployedIndex",
3 queries=[embedding[0]],
----> 4 num_neighbors=5
5 )
/opt/conda/lib/python3.7/site-packages/google/cloud/aiplatform/matching_engine/matching_engine_index_endpoint.py in match(self, deployed_index_id, queries, num_neighbors, filter)
969
970 # Perform the request
--> 971 response = stub.BatchMatch(batch_request)
972
973 # Wrap the results in MatchNeighbor objects and return
~/.local/lib/python3.7/site-packages/grpc/_channel.py in __call__(self, request, timeout, metadata, credentials, wait_for_ready, compression)
944 state, call, = self._blocking(request, timeout, metadata, credentials,
945 wait_for_ready, compression)
--> 946 return _end_unary_response_blocking(state, call, False, None)
947
948 def with_call(self,
~/.local/lib/python3.7/site-packages/grpc/_channel.py in _end_unary_response_blocking(state, call, with_call, deadline)
847 return state.response
848 else:
--> 849 raise _InactiveRpcError(state)
850
851
_InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "failed to connect to all addresses; last error: UNKNOWN: ipv4:172.17.0.5:10000: tcp handshaker shutdown"
debug_error_string = "UNKNOWN:failed to connect to all addresses; last error: UNKNOWN: ipv4:172.17.0.5:10000: tcp handshaker shutdown {created_time:"2023-03-21T19:42:53.18178618+00:00", grpc_status:14}"
>