【发布时间】:2019-09-05 01:04:09
【问题描述】:
在使用 tf '2.0.0-alpha0' 的本地计算机上尝试 https://www.tensorflow.org/tutorials/images/hub_with_keras 的示例时(下载,pip-下载 hub '0.4.0-dev' 并删除 !pip... 行,安装 tf 2,删除 enable_v2_behavior
,运行file),它失败了
ValueError: Input 0 of layer dense is in compatible with the layer: its rank is undefined, but the layer requires a defined rank.
不过,它在 Google colab 上运行良好。为什么会这样?如何解决?
【问题讨论】:
-
用
tf-nightly-2.0-preview替换tensorflow=2.0.0-alpha0有帮助吗? -
@arnoegw:是的!非常感谢
-
@arnoegw:欢迎发布答案(为了节省时间,您可以简单地复制粘贴我的“这是固定的......”部分)。
标签: python tensorflow google-colaboratory tensorflow-hub