ValueError с использованием fastAPI - PullRequest
0 голосов
/ 27 апреля 2020

Я создал API, используя предсказания модели fastapi fora ml, он работал нормально, и вдруг я получаю эту ошибку каждый раз, когда называю ее

Traceback (most recent call last):
File "c:\users\dell\appdata\local\programs\python\python38-32\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 385, in run_asgi
    result = await app(self.scope, self.receive, self.send)
  File "c:\users\dell\appdata\local\programs\python\python38-32\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 45, in __call__
    return await self.app(scope, receive, send)
  File "c:\users\dell\appdata\local\programs\python\python38-32\lib\site-packages\fastapi\applications.py", line 149, in __call__
    await super().__call__(scope, receive, send)
  File "c:\users\dell\appdata\local\programs\python\python38-32\lib\site-packages\starlette\applications.py", line 102, in __call__
    await self.middleware_stack(scope, receive, send)
  File "c:\users\dell\appdata\local\programs\python\python38-32\lib\site-packages\starlette\middleware\errors.py", line 181, in __call__
    raise exc from None
  File "c:\users\dell\appdata\local\programs\python\python38-32\lib\site-packages\starlette\middleware\errors.py", line 159, in __call__
    await self.app(scope, receive, _send)
  File "c:\users\dell\appdata\local\programs\python\python38-32\lib\site-packages\starlette\exceptions.py", line 82, in __call__
    raise exc from None
  File "c:\users\dell\appdata\local\programs\python\python38-32\lib\site-packages\starlette\exceptions.py", line 71, in __call__
    await self.app(scope, receive, sender)
  File "c:\users\dell\appdata\local\programs\python\python38-32\lib\site-packages\starlette\routing.py", line 550, in __call__
    await route.handle(scope, receive, send)
  File "c:\users\dell\appdata\local\programs\python\python38-32\lib\site-packages\starlette\routing.py", line 227, in handle
    await self.app(scope, receive, send)
  File "c:\users\dell\appdata\local\programs\python\python38-32\lib\site-packages\starlette\routing.py", line 41, in app
    response = await func(request)
  File "c:\users\dell\appdata\local\programs\python\python38-32\lib\site-packages\fastapi\routing.py", line 155, in app
    response_data = await serialize_response(
  File "c:\users\dell\appdata\local\programs\python\python38-32\lib\site-packages\fastapi\routing.py", line 90, in serialize_response
    return jsonable_encoder(response_content)
  File "c:\users\dell\appdata\local\programs\python\python38-32\lib\site-packages\fastapi\encoders.py", line 101, in jsonable_encoder
    encoded_value = jsonable_encoder(
  File "c:\users\dell\appdata\local\programs\python\python38-32\lib\site-packages\fastapi\encoders.py", line 151, in jsonable_encoder
    raise ValueError(errors)
ValueError: [ValueError('dictionary update sequence element #0 has length 19; 2 is required'), TypeError('vars() argument must have __dict__ attribute')]

Что случилось?

...