unilm
unilm copied to clipboard
ImportError: cannot import name 'MultiHostDsn' from 'pydantic.networks' (/opt/conda/lib/python3.8/site-packages/pydantic/networks.cpython-38-x86_64-linux-gnu.so)
I followed the setup step by step, but got this Error when I am doing the last step(i.e. bash run_gradio.sh).Can you please help me to solve this problem? I really want to deploy Kosmos-2 locally. Many thanks !
File "/opt/conda/lib/python3.8/site-packages/fastapi/_compat.py", line 297, in
ImportError: cannot import name 'MultiHostDsn' from 'pydantic.networks' (/opt/conda/lib/python3.8/site-packages/pydantic/networks.cpython-38-x86_64-linux-gnu.so)
ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: 1) local_rank: 0 (pid: 7738) of binary: /opt/conda/bin/python
Traceback (most recent call last):
File "/opt/conda/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/opt/conda/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/opt/conda/lib/python3.8/site-packages/torch/distributed/launch.py", line 195, in
main()
File "/opt/conda/lib/python3.8/site-packages/torch/distributed/launch.py", line 191, in main
launch(args)
File "/opt/conda/lib/python3.8/site-packages/torch/distributed/launch.py", line 176, in launch
run(args)
File "/opt/conda/lib/python3.8/site-packages/torch/distributed/run.py", line 753, in run
elastic_launch(
File "/opt/conda/lib/python3.8/site-packages/torch/distributed/launcher/api.py", line 132, in call
return launch_agent(self._config, self._entrypoint, list(args))
File "/opt/conda/lib/python3.8/site-packages/torch/distributed/launcher/api.py", line 246, in launch_agent
raise ChildFailedError(
torch.distributed.elastic.multiprocessing.errors.ChildFailedError:
demo/gradio_app.py FAILED
Failures: <NO_OTHER_FAILURES>
Root Cause (first observed failure): [0]: time : 2023-07-09_04:02:58 host : 62e0ebebfeae rank : 0 (local_rank: 0) exitcode : 1 (pid: 7738) error_file: <N/A> traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html
Hi, you can try:
pip install --upgrade --user pydantic
@pengzhiliang tried that and it caused the following error: thinc 8.0.13 requires pydantic!=1.8,!=1.8.1,<1.9.0,>=1.7.4, but you have pydantic 2.0.2 which is incompatible. spacy 3.2.2 requires pydantic!=1.8,!=1.8.1,<1.9.0,>=1.7.4, but you have pydantic 2.0.2 which is incompatible.
Tried installing pydantic==1.7.4 but received the same error as the first post
Tried installing pydantic==1.8.2 but didn't work either.
After running
pip install --upgrade --user pydantic
I got the following error:
thinc 8.0.13 requires pydantic!=1.8,!=1.8.1,<1.9.0,>=1.7.4, but you have pydantic 2.0.2 which is incompatible.
spacy 3.2.2 requires pydantic!=1.8,!=1.8.1,<1.9.0,>=1.7.4, but you have pydantic 2.0.2 which is incompatible.
However, I am able to run the file gradio_app.py
.
Yes, we are also trying to solve the problem of version conflict.
Found the magical combination of python library versions spacy==3.6.0 thinc==8.1.10 pydantic==1.10.10