chineseocr / darknet-ocr

darknet text detect and darknet cnn ocr
MIT License
1.14k stars 285 forks source link

不管什么图片,都提示异常 #38

Open ahghygy opened 4 years ago

ahghygy commented 4 years ago

127.0.0.1:48050 - - [14/Jan/2020 18:12:47] "HTTP/1.1 POST /text" - 500 Internal Server Error Traceback (most recent call last): File "/home/ubuntu/.local/lib/python3.5/site-packages/web/application.py", line 289, in process return self.handle() File "/home/ubuntu/.local/lib/python3.5/site-packages/web/application.py", line 280, in handle return self._delegate(fn, self.fvars, args) File "/home/ubuntu/.local/lib/python3.5/site-packages/web/application.py", line 530, in _delegate return handle_class(cls) File "/home/ubuntu/.local/lib/python3.5/site-packages/web/application.py", line 508, in handle_class return tocall(*args) File "app.py", line 66, in POST data = json.loads(data) File "/usr/lib/python3.5/json/init.py", line 312, in loads s.class.name)) TypeError: the JSON object must be str, not 'bytes'

127.0.0.1:48236 - - [14/Jan/2020 18:13:35] "HTTP/1.1 POST /text" - 500 Internal Server Error

ahghygy commented 4 years ago

Screenshot from 2020-01-14 19-05-34

deeroad commented 4 years ago

把web.py卸载掉,重新安装。 我之前也遇到过,是版本问题。

ahghygy commented 4 years ago

我一斤多次卸载重装了,还是不行啊。你有什么好的安装方法吗?

$ pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple web.py --user Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Processing /home/ubuntu/.cache/pip/wheels/66/56/41/0afd04dbdf7cc978f28f69f7c33b488b2c62ef14980345bc38/web.py-0.40-cp35-none-any.whl Requirement already satisfied: cheroot in /home/ubuntu/.local/lib/python3.5/site-packages (from web.py) (8.2.1) Requirement already satisfied: markdown in /usr/local/lib/python3.5/dist-packages (from web.py) (3.1.1) Requirement already satisfied: jaraco.functools in /home/ubuntu/.local/lib/python3.5/site-packages (from cheroot->web.py) (2.0) Requirement already satisfied: more-itertools>=2.6 in /home/ubuntu/.local/lib/python3.5/site-packages (from cheroot->web.py) (8.1.0) Requirement already satisfied: six>=1.11.0 in /home/ubuntu/.local/lib/python3.5/site-packages (from cheroot->web.py) (1.13.0) Requirement already satisfied: setuptools>=36 in /usr/local/lib/python3.5/dist-packages (from markdown->web.py) (41.2.0) Installing collected packages: web.py Successfully installed web.py-0.40

sxjpage commented 4 years ago

字符串编码问题

wenlihaoyu commented 4 years ago

python=3.6,python3.5 json.loads是字符串不是字节,要先转码

jolyi-max commented 4 years ago

我也遇到了这个问题 web.py框架不支持python 3.7需要把python版本更换为3.6 这个问题就解决了

ahghygy commented 4 years ago

多谢大神,我升级到Python3.6 试一下