google-ai-edge/model-explorer

How to shutdown server?

poutyface opened this issue · 7 comments

How to shutdown server?

Hi @poutyface, after you start the server it should give you instructions on how to stop:

$ model-explorer
Loading extensions...
Loaded 8 extensions:
 - TFLite adapter (Flatbuffer)
 - TFLite adapter (MLIR)
 - TF adapter (MLIR)
 - TF adapter (direct)
 - GraphDef adapter
 - Pytorch adapter (exported program)
 - MLIR adapter
 - JSON adapter

Starting Model Explorer server at:
http://localhost:8080

Press Ctrl+C to stop.

Does Ctrl+C work for you? Let us know if this works.

hmm Ctrl+C don’t work on ubuntu22.04

$ model-explorer —host 0.0.0.0 —port 8080

I noticed that "Starting Model Explorer server at: ..." message was not output.
however, i can access server and browse model graph.

Loading extensions...
Loaded 8 extensions:
 - TFLite adapter (Flatbuffer)
 - TFLite adapter (MLIR)
 - TF adapter (MLIR)
 - TF adapter (direct)
 - GraphDef adapter
 - Pytorch adapter (exported program)
 - MLIR adapter
 - JSON adapter

Seeing the same thing on Ubuntu 22.04 on WSL. Was only able to close the server using pkill pid.

Hi @poutyface and @KevinKaChunLee, I have not been able to reproduce with Ubuntu or Debian. I have not been able to try WSL but that could be a good clue. Do you guys usually use Ctrl+C to stop processes within your workflows normally? Is there any other environmental factor which can explain the different reaction? Such as..

Python version? Conda/venv? Is there any other output? Any other options supplied to the command? Any additional information will be helpful. Thanks.

Hi @pkgoogle , I am running python 3.12.2 in a virtual env. Ctrl + C usually works to cancel other processes.

It's strange we don't get any of the following prints after -JSON adaptor. Perhaps something is hanging preventing stdin to be captured from the keyboard. The server appears to be running fine, so I imagine it to occur between starting the server and printing out "Starting Model Explorer" print line.

Pressing Ctrl+C just shows ^C in the terminal which shows the input is being captured by the terminal, but its just not being registered. Ctrl + Z still works in suspending the program.

The issue seems related to running the server through a proxy. The request never gets the 200 response status code so the code is stuck in this while loop.

while True:
try:
response = requests.get(f'http://{host}:{port}/')
except:
continue
if response.status_code == 200:
break

Hi @KevinKaChunLee, I'm feeling this is likely a WSL networking issue related to what you said above... currently trying to find an environment where I can replicate this.