I am not able to import resnet from keras.applications module

后端 未结 5 1760
滥情空心
滥情空心 2020-12-11 16:12

I\'m unable to import this module

import keras.applications.resnet

ModuleNotFoundError
in () ----> 1 import keras.a

5条回答
  •  伪装坚强ぢ
    2020-12-11 17:05

    There is a python package named 'keras-resnet' which has ResNet50, ResNet101, ResNet152 and many more variants of ResNet. (https://pypi.org/project/keras-resnet/)

    Installation is also quite easy. Just type

    pip install keras-resnet
    

    It will install this module and then use it like:

    from keras_resnet.models import ResNet50, ResNet101, ResNet152
    
    backbone = ResNet50(inputs=image_input, include_top=False, freeze_bn=True)
    C2, C3, C4, C5 = backbone.outputs # this will give you intermediate 
    # outputs of four blocks of resnet if you want to merge low and high level features
    

    I am using backbones from this module and is working fine for me!

提交回复
热议问题