mediapipe 运行代码的时候 有时候会下载模型,但是因为网络问题,可能下载不下来,报错
TimeoutError: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连 接尝试失败。
G:\project\pythonProj\pose\Pose_estimation-main>D:\project\python_project\ALBERT\venv\Scripts\python.exe mediapipe系列之一肢体行为标记.py
Downloading model to D:\project\python_project\ALBERT\venv\lib\site-packages\mediapipe/modules/pose_landmark/pose_landmark_heavy.tflite
Traceback (most recent call last):
File "mediapipe系列之一肢体行为标记.py", line 69, in <module>
main()
File "mediapipe系列之一肢体行为标记.py", line 48, in main
detector = poseDetector()
File "mediapipe系列之一肢体行为标记.py", line 19, in __init__
self.poses = self.mpPose.Pose(self.mode, self.model,self.smooth,self.detection, self.tracking)
File "D:\project\python_project\ALBERT\venv\lib\site-packages\mediapipe\python\solutions\pose.py", line 145, in __init__
_download_oss_pose_landmark_model(model_complexity)
File "D:\project\python_project\ALBERT\venv\lib\site-packages\mediapipe\python\solutions\pose.py", line 101, in _download_oss_pose_landmark_model
'mediapipe/modules/pose_landmark/pose_landmark_heavy.tflite')
File "D:\project\python_project\ALBERT\venv\lib\site-packages\mediapipe\python\solutions\download_utils.py", line 32, in download_oss_model
with urllib.request.urlopen(model_url) as response, open(model_abspath,
File "E:\software\python3.7\lib\urllib\request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "E:\software\python3.7\lib\urllib\request.py", line 525, in open
response = self._open(req, data)
File "E:\software\python3.7\lib\urllib\request.py", line 543, in _open
'_open', req)
File "E:\software\python3.7\lib\urllib\request.py", line 503, in _call_chain
result = func(*args)
File "E:\software\python3.7\lib\urllib\request.py", line 1362, in https_open
context=self._context, check_hostname=self._check_hostname)
File "E:\software\python3.7\lib\urllib\request.py", line 1322, in do_open
r = h.getresponse()
File "E:\software\python3.7\lib\http\client.py", line 1344, in getresponse
response.begin()
File "E:\software\python3.7\lib\http\client.py", line 306, in begin
version, status, reason = self._read_status()
File "E:\software\python3.7\lib\http\client.py", line 267, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "E:\software\python3.7\lib\socket.py", line 589, in readinto
return self._sock.recv_into(b)
File "E:\software\python3.7\lib\ssl.py", line 1071, in recv_into
return self.read(nbytes, buffer)
File "E:\software\python3.7\lib\ssl.py", line 929, in read
return self._sslobj.read(len, buffer)
TimeoutError: [WinError 10060] 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连 接尝试失败。
[ WARN:0] global C:\Users\runneradmin\AppData\Local\Temp\pip-req-build-_xlv4eex\opencv\modules\videoio\src\cap_msmf.cpp (438) `anonymous-namespace'::SourceReaderCB::~SourceReaderCB terminating async callback
可以去 码云下载
https://gitee.com/mirrors/mediapipe/tree/master/mediapipe/modules/pose_landmark
就是这里写了 他会把他下载到什么文件夹:
Downloading model to D:\project\python_project\ALBERT\venv\lib\site-packages\mediapipe/modules/pose_landmark/pose_landmark_heavy.tflite
比如是这个模型
pose_landmark_heavy.tflite
你就去码云里把对应的文件下载下来,然后创建那个目录,把这个文件放在这里
不过当时我记得好像是突然他又可以正常下载了。。所以我好像也不是这样做的。。不知道这样做的话,会不会出问题啊