我无法从 keras.applications 模块导入 resnet [英] I am not able to import resnet from keras.applications module

查看:84
本文介绍了我无法从 keras.applications 模块导入 resnet的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法导入此模块

导入 keras.applications.resnet

<块引用>

ModuleNotFoundError
在 ()----> 1 导入 keras.applications.resnet

ModuleNotFoundError: 没有名为keras.applications.resnet"的模块

<小时>

keras resnet 链接

解决方案

Keras 团队在当前模块中没有包含 resnet、resnet_v2 和 resnext,它们将从 Keras 2.2.5 中添加,如前所述 这里.

作为一种解决方法,您可以直接使用 keras_applications 模块导入所有 ResNet、ResNetV2 和 ResNeXt 模型,如下所示

from keras_applications.resnet 导入 ResNet50

或者如果您只想使用 ResNet50

 from keras.applications.resnet50 导入 ResNet50

或者,您始终可以按照此处所述从源代码构建.

I'm unable to import this module

import keras.applications.resnet

ModuleNotFoundError
in () ----> 1 import keras.applications.resnet

ModuleNotFoundError: No module named 'keras.applications.resnet'


keras resnet link

解决方案

Keras team hasn't included resnet, resnet_v2 and resnext in the current module, they will be added from Keras 2.2.5, as mentioned here.

For a workaround, you can use keras_applications module directly to import all ResNet, ResNetV2 and ResNeXt models, as given below

from keras_applications.resnet import ResNet50

Or if you just want to use ResNet50

from keras.applications.resnet50 import ResNet50

Alternatively, you can always build from source as mentioned here.

这篇关于我无法从 keras.applications 模块导入 resnet的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆