关于tensorflow:ValueError-Unable-to-create-group-name-already-exists

65次阅读

共计 785 个字符,预计需要花费 2 分钟才能阅读完成。

问题形容:

在 tensorflow2.0.0 下保留模型呈现的 bug,

 File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/keras/saving/hdf5_format.py", line 103, in save_model_to_hdf5
    save_weights_to_hdf5_group(model_weights_group, model_layers)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/keras/saving/hdf5_format.py", line 619, in save_weights_to_hdf5_group
    g = f.create_group(layer.name)
  File "/usr/local/lib/python3.6/dist-packages/h5py/_hl/group.py", line 68, in create_group
    gid = h5g.create(self.id, name, lcpl=lcpl, gcpl=gcpl)
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "h5py/h5g.pyx", line 161, in h5py.h5g.create
ValueError: Unable to create group (name already exists)

解决办法

参考此链接,批改模型后缀为.tf/ 后者降级 tf 版本为 2.0.0 以上。采纳批改模型后缀为.tf 临时解决。

正文完
 0