Vision-CAIR / MiniGPT-4

Open-sourced codes for MiniGPT-4 and MiniGPT-v2 (https://minigpt-4.github.io, https://minigpt-v2.github.io/)
https://minigpt-4.github.io
BSD 3-Clause "New" or "Revised" License
25.4k stars 2.91k forks source link

SyntaxError: invalid syntax #188

Open JamyM0819 opened 1 year ago

JamyM0819 commented 1 year ago

Thank you for sharing such a great project, I am getting an error when trying to deploy this project has reached the final stage: (minigpt4) D:\MiniGPT-4>python demo.py --cfg-path eval_configs/minigpt4_eval.yaml --gpu-id 0 Traceback (most recent call last): File "D:\MiniGPT-4\demo.py", line 8, in import gradio as gr File "D:\anaconda3\envs\minigpt4\lib\site-packages\gradio__init.py", line 3, in import gradio.components as components File "D:\anaconda3\envs\minigpt4\lib\site-packages\gradio\components.py", line 26, in import matplotlib.figure File "D:\anaconda3\envs\minigpt4\lib\site-packages\matplotlib\init__.py", line 161, in from . import _api, _version, cbook, _docstring, rcsetup File "D:\anaconda3\envs\minigpt4\lib\site-packages\matplotlib\rcsetup.py", line 27, in from matplotlib.colors import Colormap, is_color_like File "D:\anaconda3\envs\minigpt4\lib\site-packages\matplotlib\colors.py", line 51, in from PIL import Image File "C:\Python27\Lib\site-packages\PIL\Image.py", line 57 except ImportError, v: ^ SyntaxError: invalid syntax

The following are my environment dependent libraries: (minigpt4) D:\MiniGPT-4>pip list Package Version


accelerate 0.18.0 aiofiles 23.1.0 aiohttp 3.8.4 aiosignal 1.3.1 altair 4.2.2 anyio 3.6.2 appdirs 1.4.4 async-timeout 4.0.2 attrs 23.1.0 brotlipy 0.7.0 certifi 2022.12.7 cffi 1.15.1 charset-normalizer 3.1.0 click 8.0.4 colorama 0.4.6 contourpy 1.0.7 cryptography 40.0.2 cycler 0.11.0 docker-pycreds 0.4.0 entrypoints 0.4 fastapi 0.95.1 ffmpy 0.3.0 filelock 3.9.0 fonttools 4.39.3 frozenlist 1.3.3 fschat 0.1.10 fsspec 2023.4.0 gitdb 4.0.10 GitPython 3.1.31 gradio 3.24.1 gradio_client 0.1.4 h11 0.14.0 httpcore 0.17.0 httpx 0.24.0 huggingface-hub 0.14.1 idna 3.4 importlib-metadata 6.0.0 importlib-resources 5.12.0 Jinja2 3.1.2 joblib 1.1.1 jsonschema 4.17.3 kiwisolver 1.4.4 linkify-it-py 2.0.2 markdown-it-py 2.2.0 markdown2 2.4.8 MarkupSafe 2.1.2 matplotlib 3.7.1 mdit-py-plugins 0.3.3 mdurl 0.1.2 multidict 6.0.4 MySQL-python 1.2.3 numpy 1.24.3 OpenEXR 1.2.0 OpenGLContext 2.3.0b1 OpenImageIO 1.4.15 orjson 3.8.11 packaging 23.0 pandas 2.0.1 pathtools 0.1.2 Pillow 9.3.0 pip 23.1.2 prompt-toolkit 3.0.38 protobuf 3.20.3 psutil 5.9.5 PyAlembic 1.5.3 pycparser 2.21 pydantic 1.10.7 pydub 0.25.1 Pygments 2.15.1 PyOpenGL 3.1.0 pyOpenSSL 23.1.1 pyparsing 3.0.9 pyrsistent 0.19.3 PySocks 1.7.1 python-dateutil 2.8.2 python-multipart 0.0.6 pytz 2023.3 PyYAML 6.0 regex 2022.7.9 requests 2.29.0 rich 13.3.5 sacremoses 0.0.43 semantic-version 2.10.0 sentencepiece 0.1.99 sentry-sdk 1.21.1 setproctitle 1.3.2 setuptools 67.7.2 six 1.16.0 smmap 5.0.0 sniffio 1.3.0 starlette 0.26.1 svgwrite 1.4.3 tokenizers 0.13.0.dev0 toolz 0.12.0 torch 1.12.1 torchaudio 0.12.1 torchvision 0.13.1 tqdm 4.65.0 transformers 4.29.0.dev0 typing_extensions 4.5.0 tzdata 2023.3 uc-micro-py 1.0.2 urllib3 1.26.15 uvicorn 0.22.0 VideoCapture 0.9.5 wandb 0.15.1 wavedrom 2.0.3.post3 wcwidth 0.2.6 websockets 11.0.2 wheel 0.40.0 win-inet-pton 1.1.0 yarl 1.9.2 zipp 3.11.0

JamyM0819 commented 1 year ago

卸载python2.7解决了