Vincentqyw/image-matching-webui

pydantic_core._pydantic_core.ValidationError: 1 validation error for PredictBody

KevenGe opened this issue · 7 comments

I'm using Windows and WSL, but I keep getting this error and can't really get it to work.

How do I fix this error please?

image

Task exception was never retrieved
future: <Task finished name='j7l5nczw6pi_3' coro=<Queue.process_events() done, defined at /home/qf/miniconda3/envs/imw/lib/python3.10/site-packages/gradio/queueing.py:342> exception=1 validation error for PredictBody
event_id
  Field required [type=missing, input_value={'data': ['data:image/jpe...on_hash': 'j7l5nczw6pi'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.5/v/missing>
Traceback (most recent call last):
  File "/home/qf/miniconda3/envs/imw/lib/python3.10/site-packages/gradio/queueing.py", line 346, in process_events
    client_awake = await self.gather_event_data(event)
  File "/home/qf/miniconda3/envs/imw/lib/python3.10/site-packages/gradio/queueing.py", line 219, in gather_event_data
    data, client_awake = await self.get_message(event, timeout=receive_timeout)
  File "/home/qf/miniconda3/envs/imw/lib/python3.10/site-packages/gradio/queueing.py", line 448, in get_message
    return PredictBody(**data), True
  File "/home/qf/miniconda3/envs/imw/lib/python3.10/site-packages/pydantic/main.py", line 164, in __init__
    __pydantic_self__.__pydantic_validator__.validate_python(data, self_instance=__pydantic_self__)
pydantic_core._pydantic_core.ValidationError: 1 validation error for PredictBody
event_id
  Field required [type=missing, input_value={'data': ['data:image/jpe...on_hash': 'j7l5nczw6pi'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.5/v/missing

Found the reason, it was caused by a low version of gradio. Not sure why, but after updating gradio to the latest version, the problem disappeared.

Great! By the way, which version of gradio did you encounter the issue with?

Great! By the way, which version of gradio did you encounter the issue with?

The version information at the time of this problem is as follows

# gradio==3.35.2
# gradio_client==0.2.7

When I updated to the latest version, the problem disappeared!

# gradio==4.7.1
# gradio_client==0.7.0

I don't know why the problem occurred, but the update did fix the problem. The default version is 3.35.2 that the version may be outdated and it is recommended to test if the problem is actually there.

I attempted to use gradio==4.7.1, but I encountered an issue where examples are not displayed correctly. I have submitted this issue to the official gradio repository: gradio-app/gradio#6620. If you discover any solutions, please feel free to submit a pull request.

I attempted to use gradio==4.7.1, but I encountered an issue where examples are not displayed correctly. I have submitted this issue to the official gradio repository: gradio-app/gradio#6620. If you discover any solutions, please feel free to submit a pull request.

Thank you very much for your contribution. I checked the issue gradio-app/gradio#6620 you filed in gradio and I'm having the same problem, again without finding a solution. If I find a solution, I'll reply in this issue

Fixed by updating gradio:

pip install gradio>=4.12.0

Fixed by updating gradio:

pip install gradio>=4.12.0

The same issue has been fixed after updating the version of the gradio, so could you update the gradio version in the requirements.txt ? Thanks❤