我想在Keras中加载经过预先训练的ResNet50v2模型。我试过了
keras.applications.resnet_v2.ResNet50V2()这引起了一个错误
Traceback (most recent call last):
File "<input>", line 1, in <module>
AttributeError: module 'keras.applications' has no attribute 'resnet_v2'在搜索该错误时,this answer建议使用keras_applications包。所以我试着
keras_applications.resnet_v2.ResNet50V2()这就给出了错误
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/home/nagabhushan/.local/lib/python3.6/site-packages/keras_applications/resnet_common.py", line 495, in ResNet50V2
**kwargs)
File "/home/nagabhushan/.local/lib/python3.6/site-packages/keras_applications/resnet_common.py", line 348, in ResNet
data_format=backend.image_data_format(),
AttributeError: 'NoneType' object has no attribute 'image_data_format'在搜索该错误时,this answer建议使用keras.applications包。我很困惑。如何加载ResNetv2模型?
注意:我能够加载ResNet50。只有ResNet50v2才有问题
from keras.applications.resnet50 import ResNet50发布于 2019-11-09 07:21:21
import keras
keras.applications.resnet_v2.ResNet50V2()以上代码在jupyter笔记本中执行。
在安装Keras之前,请安装它的一个后端引擎TensorFlow

https://stackoverflow.com/questions/58776787
复制相似问题