我从这个链接克隆的人类姿态估计keras模型人体姿势估计keras
当我尝试在Google Colab上加载模型时,出现以下错误
码
from keras.models import load_model
model = load_model('model.h5')
Run Code Online (Sandbox Code Playgroud)
错误
ValueError Traceback (most recent call
last)
<ipython-input-29-bdcc7d8d338b> in <module>()
1 from keras.models import load_model
----> 2 model = load_model('model.h5')
/usr/local/lib/python3.6/dist-packages/keras/engine/saving.py in load_model(filepath, custom_objects, compile)
417 f = h5dict(filepath, 'r')
418 try:
--> 419 model = _deserialize_model(f, custom_objects, compile)
420 finally:
421 if opened_new_file:
/usr/local/lib/python3.6/dist-packages/keras/engine/saving.py in _deserialize_model(f, custom_objects, compile)
219 return obj
220
--> 221 model_config = f['model_config']
222 if model_config is None:
223 raise ValueError('No model found …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 dnn 模块中的 blobFromImages 创建多个帧的 blob。
def batch_process(self, frames):
blob = cv.dnn.blobFromImages(frames, 1./255, (368, 368), (0, 0, 0), swapRB=False, crop=False)
self.net.setInput(blob)
out = self.net.forward()
detected_points = np.zeros((frames.shape[0], 36))
for i in range(frames.shape[0]):
points = np.array([])
for j in range(18):
heatMap = out[i, j, :, :]
_, conf, _, point = cv.minMaxLoc(heatMap)
if conf > 0.1:
points = np.append(points, [point[0], point[1]])
else:
points = np.append(points, [0, 0])
detected_points[i] = points
return detected_points
Run Code Online (Sandbox Code Playgroud)
但是当我调用该函数时,我收到如下错误:-
OpenCV(3.4.1) Error: Assertion failed (image.depth() == 5) in …Run Code Online (Sandbox Code Playgroud)