You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Movenet多人姿态估计模型导入失败问题求助

Movenet多人姿态估计模型加载问题

在线加载模型报错

执行代码:

import tensorflow as tf
import tensorflow_hub as hub

model = hub.load("https://tfhub.dev/google/movenet/multipose/lightning/1")
movenet = model.signatures['serving_default']

报错信息:

OSError: SavedModel file does not exist at: /var/folders/tc/c08qbx_s61bbx4bxq4rt8wxw0000gn/T/tfhub_modules/312f001449331ee3d410d758fccdc9945a65dbc3/{saved_model.pbtxt|saved_model.pb}

此前代码可正常运行,且符合TensorFlow官方文档说明,无法定位问题原因。

本地模型导入需求

已手动将模型下载到本地,需要了解如何将本地模型导入程序。


在线加载报错的排查与解决

  • 缓存损坏:TF Hub会将下载的模型缓存到本地临时文件夹,若下载中断会导致缓存不完整。直接删除报错信息中指定的缓存文件夹,重新运行代码即可重新下载模型。
  • 版本不兼容:检查TensorFlow和TensorFlow Hub版本是否与模型要求匹配,可执行以下命令更新到稳定版本:
    pip install --upgrade tensorflow tensorflow-hub
    

本地模型导入步骤

确保本地下载的模型文件夹包含完整的SavedModel结构(存在saved_model.pb/saved_model.pbtxt文件和variables目录),然后将hub.load的参数替换为本地路径:

import tensorflow as tf
import tensorflow_hub as hub

# 替换为你的本地模型文件夹路径
model = hub.load("/path/to/your/local/movenet_model")
movenet = model.signatures['serving_default']

内容的提问来源于stack exchange,提问作者Freek Cool

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.20 01:45:38