perone / euclidesdb

A multi-model machine learning feature embedding database
http://euclidesdb.readthedocs.io
Other
633 stars 31 forks source link

Segmentation fault (core dumped) #20

Open mlcoop opened 5 years ago

mlcoop commented 5 years ago

I have launched EuclidesDB on local machine. Have added 48042 items into annoy index. But then I can't get similar images using db.find_similar_image(img, ["resnet18"], 7)

channel = euclides.Channel("localhost", 50000)
db = euclides.EuclidesDB(channel)
ret_similar = db.find_similar_image(img, ["resnet18"], 7)

Because my EuclidesDB returns

[EuclidesDB] 2019-02-13 04:28:23,373 [INFO]: EuclidesDB v.0.2.0 initialized.
[EuclidesDB] 2019-02-13 04:28:23,498 [INFO]: Module resnet18 loaded.
[EuclidesDB] 2019-02-13 04:28:23,510 [INFO]: Database Version 1 detected.
Segmentation fault (core dumped)

I didnt't have this error while using docker run

perone commented 5 years ago

Thanks for reporting the issue @AssylCooper, when you used Docker with the same scenario you don't get an error ? Can you tell me which OS are you using when you get this error ? Also, the segmentation fault happens after you call the db.find_similar_images or when you start EuclidesDB ?

mlcoop commented 5 years ago

HI @perone , EuclidesDB is deployed in Ubuntu 16.04 and segmentation fault happens when I relaunch EuclidesDB.

When I first launched EuclidesDB there were no errors. Then I started adding images, 48000 images in total. After it was finished I tried to search for similar Images and got status = StatusCode.UNAVAILABLE details = "Connect Failed" debug_error_string = " It seems to happend when there is no available connections.

So I tried to restart EuclidesDB and got segmentation fault

perone commented 5 years ago

Just to make sure: this is without Docker right ? In Docker it works fine ? Another question: did you made the tracing of the models with PyTorch 1.0.1 or other version ? Thanks for your reports !

mlcoop commented 5 years ago

@perone, this is without Docker, In docker it worked just fine. I actually copied model from docker and didn't add any other model. I use PyTorch 0.4.

perone commented 5 years ago

@AssylCooper thanks, I'll look into it. Remember that the last EuclidesDB version (0.2.0) uses PyTorch 1.0.1, so when you trace a model, you need to use this version of PyTorch, but I'll improve the error handling soon. Also, take a look into Faiss, I found it much better then Annoy, so you might like it.

mlcoop commented 5 years ago

@perone Thank you for your work! I'll try to upgrade PyTorch. Regarding to faiss, I found some benchmarks here http://www.itu.dk/people/pagh/SSS/ann-benchmarks/glove-data10-1_glove-query_angular.html.