AnimatedDrawings
AnimatedDrawings copied to clipboard
run my own image error @ /examples/image_to_annotations.py
Hi, when I tried to run my own image by setting up the container and following the tutorial below, it shows an error message. Here is the error message:
$ python image_to_animation.py drawings/garlic.png garlic_out
Traceback (most recent call last):
File "F:\animate\AnimatedDrawings-0.0.1\examples\image_to_animation.py", line 39, in <module>
image_to_animation(img_fn, char_anno_dir, motion_cfg_fn, retarget_cfg_fn)
File "F:\animate\AnimatedDrawings-0.0.1\examples\image_to_animation.py", line 17, in image_to_animation
image_to_annotations(img_fn, char_anno_dir)
File "F:\animate\AnimatedDrawings-0.0.1\examples\image_to_annotations.py", line 50, in image_to_annotations
detection_results = json.loads(resp.content)
File "C:\Users\zhuxulu\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Users\zhuxulu\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\zhuxulu\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Python's version:3.9.2 os version win11 home How should I solve the problem? Thanks!
Hello,
I haven't tested this on Windows 11, that may be a source of the problem. But it looks like the response from the torchserve inside the docker container isn't in the format that's being expected. There's probably some sort of error there.
Can you inspect or print the contents of resp
directly before the line in which the error occurs detection_results = json.loads(resp.content)
?
Tengo el mismo problema :(
Same thing happened, MacBook Pro Max, M2, run everything as readme.md
animated_drawings) user@usermbp examples % python image_to_animation.py drawings/garlic.png garlic_out
Traceback (most recent call last):
File "image_to_animation.py", line 41, in <module>
image_to_animation(img_fn, char_anno_dir, motion_cfg_fn, retarget_cfg_fn)
File "image_to_animation.py", line 19, in image_to_animation
image_to_annotations(img_fn, char_anno_dir)
File "/Users/user/work/python/AnimatedDrawings/examples/image_to_annotations.py", line 52, in image_to_annotations
detection_results = json.loads(resp.content)
File "/Users/user/miniconda3/envs/animated_drawings/lib/python3.8/json/__init__.py", line 357, in loads
return _default_decoder.decode(s)
File "/Users/user/miniconda3/envs/animated_drawings/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Users/user/miniconda3/envs/animated_drawings/lib/python3.8/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
你好,当我尝试通过设置容器并按照下面的教程运行我自己的图像时,它显示了一条错误消息。 这是错误消息:
$ python image_to_animation.py drawings/garlic.png garlic_out Traceback (most recent call last): File "F:\animate\AnimatedDrawings-0.0.1\examples\image_to_animation.py", line 39, in <module> image_to_animation(img_fn, char_anno_dir, motion_cfg_fn, retarget_cfg_fn) File "F:\animate\AnimatedDrawings-0.0.1\examples\image_to_animation.py", line 17, in image_to_animation image_to_annotations(img_fn, char_anno_dir) File "F:\animate\AnimatedDrawings-0.0.1\examples\image_to_annotations.py", line 50, in image_to_annotations detection_results = json.loads(resp.content) File "C:\Users\zhuxulu\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 346, in loads return _default_decoder.decode(s) File "C:\Users\zhuxulu\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Users\zhuxulu\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Python版本:3.9.2 os version win11 home 请问应该怎么解决? 谢谢!
hello are you resolve this question?can you help me to teach that how can you run the project on windows 10. i tried to run in win 10 ,but when i run the docker container i got a question that i cant access to connect the torch server when i curl localhost:8080 always response is a empty server looking forward to your reply thanks!
你好,当我尝试通过设置容器并按照下面的教程运行我自己的图像时,它显示了一条错误消息。 这是错误消息:
$ python image_to_animation.py drawings/garlic.png garlic_out Traceback (most recent call last): File "F:\animate\AnimatedDrawings-0.0.1\examples\image_to_animation.py", line 39, in <module> image_to_animation(img_fn, char_anno_dir, motion_cfg_fn, retarget_cfg_fn) File "F:\animate\AnimatedDrawings-0.0.1\examples\image_to_animation.py", line 17, in image_to_animation image_to_annotations(img_fn, char_anno_dir) File "F:\animate\AnimatedDrawings-0.0.1\examples\image_to_annotations.py", line 50, in image_to_annotations detection_results = json.loads(resp.content) File "C:\Users\zhuxulu\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 346, in loads return _default_decoder.decode(s) File "C:\Users\zhuxulu\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Users\zhuxulu\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Python版本:3.9.2 os version win11 home 请问应该怎么解决? 谢谢!
hello are you resolve this question?can you help me to teach that how can you run the project on windows 10. i tried to run in win 10 ,but when i run the docker container i got a question that i cant access to connect the torch server when i curl localhost:8080 always response is a empty server looking forward to your reply thanks!
I haven't solved this problem yet
你好,当我尝试通过设置容器并按照下面的教程运行我自己的图像时,它显示了一条错误消息。 这是错误消息:
$ python image_to_animation.py drawings/garlic.png garlic_out Traceback (most recent call last): File "F:\animate\AnimatedDrawings-0.0.1\examples\image_to_animation.py", line 39, in <module> image_to_animation(img_fn, char_anno_dir, motion_cfg_fn, retarget_cfg_fn) File "F:\animate\AnimatedDrawings-0.0.1\examples\image_to_animation.py", line 17, in image_to_animation image_to_annotations(img_fn, char_anno_dir) File "F:\animate\AnimatedDrawings-0.0.1\examples\image_to_annotations.py", line 50, in image_to_annotations detection_results = json.loads(resp.content) File "C:\Users\zhuxulu\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 346, in loads return _default_decoder.decode(s) File "C:\Users\zhuxulu\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Users\zhuxulu\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Python版本:3.9.2 os version win11 home 请问应该怎么解决? 谢谢!
hello are you resolve this question?can you help me to teach that how can you run the project on windows 10. i tried to run in win 10 ,but when i run the docker container i got a question that i cant access to connect the torch server when i curl localhost:8080 always response is a empty server looking forward to your reply thanks!
I haven't solved this problem yet
i m troubled by the previous step that when i curl localhost:8080/ping and i always got is empty server
but i maybe have a suggestion your error log is reported by the origin code line:
resp = requests.post("http://localhost:8080/predictions/drawn_humanoid_pose_estimator", files=data_file, verify=False) pose_results = json.loads(resp.content)
maybe you should debug here or add log here to analysis,If the problem is that different systems cause inconsistent return data formats ,Perhaps you can reformat the data yourself to resolve it
for example:
resp = requests.post("http://localhost:8080/predictions/drawn_humanoid_pose_estimator", files=data_file, verify=False) reformatData = reformat(resp.content) pose_results = json.loads(reformatData)
I haven't tried to run this code on windows myself, and so don't have great insight into likely causes of your problems.
But there is clearly an issue with the torchserver inside of your docker. Try using macos or ubuntu 18.04 for this project if that is an option for you.
I've encountered the same problem,win10 home system
Can you guys show the messages you get from torchserve? That could help a lot to narrow down what is the cause. Try to see the log file in your docker container if you could see some errors there.
(animated_drawings) C:\Users\user\AnimatedDrawings\examples>python image_to_animation.py drawings/garlic.png garlic_out
Traceback (most recent call last):
File "C:\Users\user\miniconda3\envs\animated_drawings\lib\site-packages\urllib3\connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "C:\Users\user\miniconda3\envs\animated_drawings\lib\site-packages\urllib3\connectionpool.py", line 449, in _make_request
six.raise_from(e, None)
File "
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\user\miniconda3\envs\animated_drawings\lib\site-packages\requests\adapters.py", line 489, in send
resp = conn.urlopen(
File "C:\Users\user\miniconda3\envs\animated_drawings\lib\site-packages\urllib3\connectionpool.py", line 787, in urlopen
retries = retries.increment(
File "C:\Users\user\miniconda3\envs\animated_drawings\lib\site-packages\urllib3\util\retry.py", line 550, in increment
raise six.reraise(type(error), error, _stacktrace)
File "C:\Users\user\miniconda3\envs\animated_drawings\lib\site-packages\urllib3\packages\six.py", line 769, in reraise
raise value.with_traceback(tb)
File "C:\Users\user\miniconda3\envs\animated_drawings\lib\site-packages\urllib3\connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "C:\Users\user\miniconda3\envs\animated_drawings\lib\site-packages\urllib3\connectionpool.py", line 449, in _make_request
six.raise_from(e, None)
File "
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\user\AnimatedDrawings\examples\image_to_animation.py", line 41, in
I am using windows 10 and Python 3.10.10
***After reinstall python 3.8.13 the problem was fixed !
Hi, when I tried to run my own image by setting up the container and following the tutorial below, it shows an error message. Here is the error message:
$ python image_to_animation.py drawings/garlic.png garlic_out Traceback (most recent call last): File "F:\animate\AnimatedDrawings-0.0.1\examples\image_to_animation.py", line 39, in <module> image_to_animation(img_fn, char_anno_dir, motion_cfg_fn, retarget_cfg_fn) File "F:\animate\AnimatedDrawings-0.0.1\examples\image_to_animation.py", line 17, in image_to_animation image_to_annotations(img_fn, char_anno_dir) File "F:\animate\AnimatedDrawings-0.0.1\examples\image_to_annotations.py", line 50, in image_to_annotations detection_results = json.loads(resp.content) File "C:\Users\zhuxulu\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 346, in loads return _default_decoder.decode(s) File "C:\Users\zhuxulu\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Users\zhuxulu\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Python's version:3.9.2 os version win11 home How should I solve the problem? Thanks! Try install python 3.8.13