tensorflow_hub在Google App Engine上不起作用

问题描述

以下python代码在Google App Engine上引发错误

import tensorflow_hub as hub
embed = hub.Module("https://tfhub.dev/google/universal-sentence-encoder/4")

错误

RuntimeError: Missing implementation that supports: loader(*('/tmp/tfhub_modules/063d866c06683311b44b4992fd46003be952409c',),**{})

我的app.yaml是标准环境,正在使用

instance_class: F4_1G

这在我的本地机器上有效

解决方法

似乎与发布的here类似。您能否确定此缓解措施是否对您有帮助?

使用存在但不包含已知模块格式的tfhub_module.pb文件的目录时,将出现错误消息“ RuntimeError:缺少实现...”。特别是,您可以通过尝试从包含其他内容的目录中加载hub.Module来获得此消息。