Giter Club home page Giter Club logo

lobe_fastapi's People

Contributors

tkinjo1985 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

hikaruright

lobe_fastapi's Issues

Connection refused

port 8000 is refusing connections from a browser and from command line.

Even on the same device:

# docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                            NAMES
c627fdb99a2e        lobefastapi_web     "uvicorn main:app --…"   18 minutes ago      Up 11 minutes       80/tcp, 0.0.0.0:8000->8000/tcp   lobefastapi_web_1
# nc -vz localhost 8000
Connection to localhost 8000 port [tcp/*] succeeded!
# curl localhost:8000/docs  
curl: (56) Recv failure: Connection reset by peer
# curl http://127.0.0.1:8000/docs
curl: (56) Recv failure: Connection reset by peer
docker exec -i -t lobefastapi_web_1 bashroot@c627fdb99a2e:/work# ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.5  0.2  25972 17624 pts/0    Ss+  22:15   0:05 /usr/local/bin/python /usr/local/bin/uvicorn main:app --reload --host 0.0.0.0 --port 8000
root         8  0.0  0.1  13156  9864 pts/0    S+   22:15   0:00 /usr/local/bin/python -c from multiprocessing.resource_tracker import main;main(4)
root         9  0.0  0.0      0     0 pts/0    Z+   22:15   0:00 [python] <defunct>
root        51  0.0  0.0   5748  3552 pts/1    Ss   22:32   0:00 bash
root        57  0.0  0.0   9388  3096 pts/1    R+   22:33   0:00 ps aux

root@c627fdb99a2e:/work# curl http://127.0.0.1:8000/docs
curl: (7) Failed to connect to 127.0.0.1 port 8000: Connection refused

Internal Server Error - KeyError Prediction

Hello there,

I just booted this up to test the functionality with the stated docker commands and it returns me an error when uploading a picture. I have only a couple of minutes of experience with the script but will try to understand what the actual error is.

INFO: 172.19.0.1:40258 - "POST /predict_from_image/ HTTP/1.1" 500 Internal Server Error ERROR: Exception in ASGI application Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/uvicorn/protocols/http/h11_impl.py", line 366, in run_asgi result = await app(self.scope, self.receive, self.send) File "/usr/local/lib/python3.8/dist-packages/uvicorn/middleware/proxy_headers.py", line 75, in __call__ return await self.app(scope, receive, send) File "/usr/local/lib/python3.8/dist-packages/fastapi/applications.py", line 261, in __call__ await super().__call__(scope, receive, send) File "/usr/local/lib/python3.8/dist-packages/starlette/applications.py", line 112, in __call__ await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/errors.py", line 181, in __call__ raise exc File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/errors.py", line 159, in __call__ await self.app(scope, receive, _send) File "/usr/local/lib/python3.8/dist-packages/starlette/exceptions.py", line 82, in __call__ raise exc File "/usr/local/lib/python3.8/dist-packages/starlette/exceptions.py", line 71, in __call__ await self.app(scope, receive, sender) File "/usr/local/lib/python3.8/dist-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__ raise e File "/usr/local/lib/python3.8/dist-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__ await self.app(scope, receive, send) File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 656, in __call__ await route.handle(scope, receive, send) File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 259, in handle await self.app(scope, receive, send) File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 61, in app response = await func(request) File "/usr/local/lib/python3.8/dist-packages/fastapi/routing.py", line 227, in app raw_response = await run_endpoint_function( File "/usr/local/lib/python3.8/dist-packages/fastapi/routing.py", line 160, in run_endpoint_function return await dependant.call(**values) File "/work/./main.py", line 38, in predict label = model.predict(image) File "/work/./model.py", line 50, in predict predict = self.infer(image)['Prediction'][0] KeyError: 'Prediction'

AttributeError: 'NoneType' object has no attribute 'astype`

Hello,

something does not work for me using the base64 detection endpoint:

INFO: 172.19.0.1:40262 - "POST /predict_from_base64/ HTTP/1.1" 500 Internal Server Error ERROR: Exception in ASGI application Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/uvicorn/protocols/http/h11_impl.py", line 366, in run_asgi result = await app(self.scope, self.receive, self.send) File "/usr/local/lib/python3.8/dist-packages/uvicorn/middleware/proxy_headers.py", line 75, in __call__ return await self.app(scope, receive, send) File "/usr/local/lib/python3.8/dist-packages/fastapi/applications.py", line 261, in __call__ await super().__call__(scope, receive, send) File "/usr/local/lib/python3.8/dist-packages/starlette/applications.py", line 112, in __call__ await self.middleware_stack(scope, receive, send) File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/errors.py", line 181, in __call__ raise exc File "/usr/local/lib/python3.8/dist-packages/starlette/middleware/errors.py", line 159, in __call__ await self.app(scope, receive, _send) File "/usr/local/lib/python3.8/dist-packages/starlette/exceptions.py", line 82, in __call__ raise exc File "/usr/local/lib/python3.8/dist-packages/starlette/exceptions.py", line 71, in __call__ await self.app(scope, receive, sender) File "/usr/local/lib/python3.8/dist-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__ raise e File "/usr/local/lib/python3.8/dist-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__ await self.app(scope, receive, send) File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 656, in __call__ await route.handle(scope, receive, send) File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 259, in handle await self.app(scope, receive, send) File "/usr/local/lib/python3.8/dist-packages/starlette/routing.py", line 61, in app response = await func(request) File "/usr/local/lib/python3.8/dist-packages/fastapi/routing.py", line 227, in app raw_response = await run_endpoint_function( File "/usr/local/lib/python3.8/dist-packages/fastapi/routing.py", line 160, in run_endpoint_function return await dependant.call(**values) File "/work/./main.py", line 46, in predict_from_base64 decimg = cv2.imdecode(image_np, 1).astype(np.float32) / 225.0 AttributeError: 'NoneType' object has no attribute 'astype

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.