我正在使用注意力网络进行文档分类。培训部分成功完成。但是我无法将模型保存为h5格式的文件。 我的后端是Theano,正在使用以下python lib。 h5py == 2.7.1 Keras == 2.0.8 Theano == 1.0.2
models_json = model.to_json()
with open('model/model.json', 'w') as json_file:
json_file.write(models_json)
model.save_weights('model/mode1.h5')
h5py/_objects.pyx in h5py._objects.with_phil.wrapper()
h5py/_objects.pyx in h5py._objects.with_phil.wrapper()
h5py/h5o.pyx in h5py.h5o.link()
RuntimeError: Unable to create link (name already exists)