cyrildiagne / basnet-http

HTTP service wrapper for BASNet: Boundary-Aware Salient Object Detection

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: Empty reply from server

rakibtg opened this issue · comments

Hi, thanks for the project!

I am trying to run it using docker and i have followed the instructions provided in the readme file. Everything looks good, but i have changed the host port to 8020 due to some other local project.

When i try it using curl it looks like this:

Running container logs:

Do you have any thoughts? Thanks.


Looks like the instruction in my README is wrong. The server is listening on port 80 (as defined in the docker file) so could you try mounting port 80 instead of 8080? 8020:80

If that works, I'll fix the README.

@cyrildiagne Thanks for the quick response. Yes it does solved the issue. But however, it is still returning empty response.

Where should i move the resnet34-333f7ec4.pth file?


Looks like the instruction in my README is wrong. The server is listening on port 80 (as defined in the docker file) so could you try mounting port 80 instead of 8080? 8080:80

If that works, I'll fix the README.

It also worked for me

Where should i move the resnet34-333f7ec4.pth file?

In the root of this project, the same directory where the Dockerfile is. This could also be made more clear in the README

Hi This looks really interesting but I also get the empty reply. I've tried your prebuilt image and built my own with the same result.

If I browse to the http://localhost:8080 I get the "Hello BASNet!" response. I am using one of the existing test images from BASNet. My resnet34-333f7ec4.pth is alongside my dockerfile. My basnet.pth is in the BASNet\saved_models\basnet_bsi folder.

docker run --rm -p 8080:80 [2020-05-05 01:54:37 +0000] [1] [INFO] Starting gunicorn 19.9.0
[2020-05-05 01:54:37 +0000] [1] [INFO] Listening at: (1)
[2020-05-05 01:54:37 +0000] [1] [INFO] Using worker: sync
[2020-05-05 01:54:37 +0000] [8] [INFO] Booting worker with pid: 8
[2020-05-05 01:56:08 +0000] [16] [INFO] Booting worker with pid: 16
[2020-05-05 01:56:20 +0000] [1] [INFO] Handling signal: term
[2020-05-05 01:56:20 +0000] [16] [INFO] Worker exiting (pid: 16)
Loading BASNet...
[2020-05-05 01:56:20 +0000] [1] [INFO] Shutting down: Master

:/mnt/f/dev/OpenSrc/.XR/ARCutPaste/BASNet-http$ curl -F "data=@test.jpg" http://localhost:8080 -o result.png
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 365k 0 0 100 365k 0 41536 0:00:09 0:00:09 --:--:-- 0
curl: (52) Empty reply from server

@MatiasConTilde Still it's sending an empty response. Is it working for you using Docker?

@rakibtg For me it worked with the prebuilt image after increasing the allocated memory in the docker desktop preferences under resources.

@cyrildiagne Nice work!

thx @viktorlorentz increase the memory solved the problem

@cyrildiagne thank you for the code !

I increased the allocated memory in docker desktop preferences but still getting this error

curl: (52) Empty reply from server

Yes this fixed it for me too - thanks - 6Mb worked for me

@amardeepsingh20 did you increase only on docker desktop settings ?
Don't forget, if you increase on docker desktop settings, don't use -m option on docker run command.

I got the same problems than you, here is what i did:

  • increase allocation memory to 2gb on docker desktop settings (it's to much, I know, but it's just to have sure that memory is not a problem at this point)
  • change default port on dockerfile ENV PORT 3000
  • run docker run --rm -p 3000:3000 basnet

Working very well.

~~ I followed @ivoneijr suggestions but I keep getting (52) Empty reply from server. ~~

EDIT: This settings work great:




I was able to get it working on my Macbook Air after increasing the worker timeout setting of gunicorn to 300 .. seems like the GPU is not getting used and it is taking upwards of 200 seconds to process one image of 800x800 pixels. :(

Thanks everyone for the feedback. I've fixed the 8080:80 port and added RAM requirements in the README.

@amardeepsingh20 Strange, on my macbookpro 2.8Ghz / 16 Gb of RAM I'm not getting this kind of latency. But yes, it runs a LOT faster with CUDA support. Nothing I can do here as it's the model's requirements.

There are many different issues in this thread now making it hard to track. I'm closing, but feel free to reopen if something's left out.


ezoic increase your site revenue