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

ElasticSearch blocks my way #126

Open
HoracceFeng opened this issue Oct 22, 2019 · 2 comments
Open

ElasticSearch blocks my way #126

HoracceFeng opened this issue Oct 22, 2019 · 2 comments

Comments

@HoracceFeng
Copy link

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)

@augustbjornberg
Copy link

Having the same issue.

@connerkward
Copy link

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.

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