【问题标题】:How to import keras-vggface in google colab?如何在谷歌 colab 中导入 keras-vggface?
【发布时间】:2020-11-27 19:41:46
【问题描述】:
我尝试像这样导入keras-vggface:
from keras_vggface.vggface import VGGFace
但它总是给我这个错误
“ModuleNotFoundError: 没有名为 'keras_vggface”的模块。
我尝试使用这样的 pip 安装keras_vggface:
!pip install --user keras-vggface
!pip install keras-vggface
!pip install git+https://github.com/rcmalli/keras-vggface.git
【问题讨论】:
标签:
python
keras
deep-learning
【解决方案1】:
我认为你需要按如下方式安装它:
!pip install keras_vggface
这就像一个魅力。
希望有用。
【解决方案2】:
在 colab 中使用 VGGFace 时也遇到了困难,通过在 colab 张量流 x1 中指定 %tensorflow_version 1.x 解决了您的问题,正如 colab 警告 VGGFace git 所告知的那样:
"VGGFAce works only with 1.x TensorFlow backend AND without eager execution!!!"
编辑:但你必须先正确调用!pip install keras_vggface