image-match icon indicating copy to clipboard operation
image-match copied to clipboard

ElasticSearch blocks my way

Open HoracceFeng opened this issue 4 years ago • 2 comments

Hi @EdjoLabs, thanks first for the share. I am now doing image matching related projects. I have done one based on resnet/efficientnet, and would like to try yours. However, things then get weird when I run the code. See the syntax error below.

I know this one should be from elasticsearch and also try the solution mentioned in #43 (use elasticsearch==2.4.0) , but still, it doesn't work

My OS: Ubuntu 14.04 elasticsearch==2.4.0 image_match=1.1.2 (I also try install it by source code, not work also)

In [30]: ses.add_image(path=add_imgpath, bytestream=True)

ConnectionError Traceback (most recent call last) in () ----> 1 ses.add_image(path=add_imgpath, bytestream=True)

/home/horacce/ERA/home/horacce/NOAH/LEARN/TCV-matcher/image-match/image_match/signature_database_base.pyc in add_image(self, path, img, bytestream, metadata, refresh_after) 207 """ 208 rec = make_record(path, self.gis, self.k, self.N, img=img, bytestream=bytestream, metadata=metadata) --> 209 self.insert_single_record(rec, refresh_after=refresh_after) 210 211 def search_image(self, path, all_orientations=False, bytestream=False, pre_filter=None):

/home/horacce/ERA/home/horacce/NOAH/LEARN/TCV-matcher/image-match/image_match/elasticsearch_driver.pyc in insert_single_record(self, rec, refresh_after) 92 def insert_single_record(self, rec, refresh_after=False): 93 rec['timestamp'] = datetime.now() ---> 94 self.es.index(index=self.index, doc_type=self.doc_type, body=rec, refresh=refresh_after) 95 96 def delete_duplicates(self, path):

/home/horacce/anaconda2/lib/python2.7/site-packages/elasticsearch/client/utils.pyc in _wrapped(*args, **kwargs) 67 if p in kwargs: 68 params[p] = kwargs.pop(p) ---> 69 return func(*args, params=params, **kwargs) 70 return _wrapped 71 return _wrapper

/home/horacce/anaconda2/lib/python2.7/site-packages/elasticsearch/client/init.pyc in index(self, index, doc_type, body, id, params) 277 raise ValueError("Empty value passed for a required argument.") 278 return self.transport.perform_request('POST' if id in SKIP_IN_PATH else 'PUT', --> 279 _make_path(index, doc_type, id), params=params, body=body) 280 281 @query_params('parent', 'preference', 'realtime', 'refresh', 'routing')

/home/horacce/anaconda2/lib/python2.7/site-packages/elasticsearch/transport.pyc in perform_request(self, method, url, params, body) 325 326 try: --> 327 status, headers, data = connection.perform_request(method, url, params, body, ignore=ignore, timeout=timeout) 328 329 except TransportError as e:

/home/horacce/anaconda2/lib/python2.7/site-packages/elasticsearch/connection/http_urllib3.pyc in perform_request(self, method, url, params, body, timeout, ignore) 103 except Exception as e: 104 self.log_request_fail(method, full_url, body, time.time() - start, exception=e) --> 105 raise ConnectionError('N/A', str(e), e) 106 107 if not (200 <= response.status < 300) and response.status not in ignore:

ConnectionError: ConnectionError(<urllib3.connection.HTTPConnection object at 0x7f6dbfda72d0>: Failed to establish a new connection: [Errno 111] Connection refused) caused by: NewConnectionError(<urllib3.connection.HTTPConnection object at 0x7f6dbfda72d0>: Failed to establish a new connection: [Errno 111] Connection refused)

HoracceFeng avatar Oct 22 '19 10:10 HoracceFeng

Having the same issue.

augustbjornberg avatar Oct 30 '19 19:10 augustbjornberg

I got around this by using the Dockerized version dsys/Match. Then I had to change one of the default environment variables to get it to play nicely with its Elasticsearch.

connerkward avatar Feb 04 '22 19:02 connerkward