Python __init_;()为关键字参数';获取了多个值;过滤器';在keras中加载保存的模型时出现类型错误

Python __init_;()为关键字参数';获取了多个值;过滤器';在keras中加载保存的模型时出现类型错误,python,tensorflow,keras,deep-learning,tf.keras,Python,Tensorflow,Keras,Deep Learning,Tf.keras,我不知道我的代码出了什么问题,或者keras中是否存在任何bug? 从磁盘加载保存的模型时,出现以下错误: __init__() got multiple values for keyword argument 'filters' TypeError 这是我保存模型和加载回shell的代码 import h5py keras_mnist_model = 'mobilenet_model_keras_.h5' m.save(filepath = keras_mnist_model) 从磁盘加载

我不知道我的代码出了什么问题,或者keras中是否存在任何bug? 从磁盘加载保存的模型时,出现以下错误:

__init__() got multiple values for keyword argument 'filters' TypeError
这是我保存模型和加载回shell的代码

import h5py
keras_mnist_model = 'mobilenet_model_keras_.h5'
m.save(filepath = keras_mnist_model)
从磁盘加载模型的代码:

# from tensorflow.keras.models import load_model
from keras.models import load_model
model = load_model(filepath = keras_mnist_model)
完整错误消息:

TypeError回溯(最近一次调用)
在里面
1#从tensorflow.keras.models导入负载#模型
2从keras.models导入负载_模型
---->3模型=加载模型(文件路径=keras\u mnist\u模型)
加载模型中的~/code/data science/tflite\u face\u recognition/model/venv/lib/python3.6/site-packages/keras/engine/saving.py(文件路径,自定义对象,编译)
417
418#论点
-->419组:指向HDF5组的指针。
420 name:要加载的属性的名称。
421
~/code/data-science/tflite\u-face\u-recognition/model/venv/lib/python3.6/site-packages/keras/engine/saving.py在反序列化模型中(f,自定义对象,编译)
223“”处理自定义对象查找。
224
-->225#论点
226对象:对象、目录或列表。
227
~/code/data-science/tflite\u-face\u-recognition/model/venv/lib/python3.6/site-packages/keras/engine/saving.py从配置(配置,自定义对象)在模型中
456将属性保存到hdf5组(g,‘权重名称’、权重名称)
457表示名称,邮政编码中的val(重量名称,重量值):
-->458 param_dset=g.create_数据集(名称,val.shape,
459 dtype=val.dtype)
460如果不是val.shape:
反序列化中的~/code/data-science/tflite\u-face\u-recognition/model/venv/lib/python3.6/site-packages/keras/layers/\u-init\u.py(配置,自定义对象)
53模块_对象=全局,
54自定义对象=自定义对象,
--->55可打印\u模块\u name='layer')
反序列化keras对象(标识符、模块对象、自定义对象、可打印模块名称)中的~/code/data science/tflite\u face\u recognition/model/venv/lib/python3.6/site-packages/keras/utils/generic\u utils.py
143配置['config'],
144 custom\u objects=dict(列表(\u GLOBAL\u custom\u objects.items())+
-->145列表(自定义_对象.items())
146带有CustomObjectScope(自定义对象):
147从_config(config['config'])返回cls
~/code/data-science/tflite\u-face\u-recognition/model/venv/lib/python3.6/site-packages/keras/engine/network.py from\u-config(cls、配置、自定义对象)
1020(尚不存在)重新排队,进程
重复1021#,直到处理完所有节点。
->1022未处理的_节点时:
1023对于配置['layers']中的层_数据:
1024层=已创建的层[层数据['name']]
~/code/data science/tflite\u face\u recognition/model/venv/lib/python3.6/site-packages/keras/engine/network.py进程层(数据层)
1006#收集图层输入。
1007入站_节点_数据=层_数据['inbound_节点']
->1008对于入站\u节点\u数据中的节点\u数据:
1009#我们不处理节点(即进行层调用)
1010#正在运行,因为入站节点可能还不存在,
反序列化中的~/code/data-science/tflite\u-face\u-recognition/model/venv/lib/python3.6/site-packages/keras/layers/\u-init\u.py(配置,自定义对象)
53模块_对象=全局,
54自定义对象=自定义对象,
--->55可打印\u模块\u name='layer')
反序列化keras对象(标识符、模块对象、自定义对象、可打印模块名称)中的~/code/data science/tflite\u face\u recognition/model/venv/lib/python3.6/site-packages/keras/utils/generic\u utils.py
145列表(自定义_对象.items())
146带有CustomObjectScope(自定义对象):
-->147从_config(config['config'])返回cls
148.其他:
149#那么'cls'可能是一个返回类的函数。
~/code/data science/tflite\u face\u recognition/model/venv/lib/python3.6/site-packages/keras/engine/base\u layer.py from\u config(cls,config)
1107层实例。
1108         """
->1109返回cls(**配置)
1110
1111 def计数参数(自身):
~/code/data science/tflite\u face\u recognition/model/venv/lib/python3.6/site-packages/keras/layers/convolutional.py in__(self、内核大小、步幅、填充、深度乘数、数据格式、激活、使用偏移、深度偏移初始值设定项、偏移初始值设定项、深度偏移正则化器、偏移正则化器、活动正则化器、深度偏移约束、偏移约束、**kwargs)
1795正则化器=自深正则化器,
1796约束=自深(U约束)
-> 1797 
1798如果自我使用偏差:
1799 self.bias=self.add_weight(形状=(输入尺寸*self.depth_乘数,),
TypeError:\uuuu init\uuuu()为关键字参数“filters”获取了多个值

哪个对象是
m
m.save()
中引用的对象?@cvonsteg
m
是模型对象。``m=MobileNet(classes=2)``哪个对象是
m
m.save()
中引用的对象?@cvonsteg
m
是模型对象。``m=MobileNet(classes=2)```