You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def loadWeightsPartial( model , weights_path , n_layers ):
# f=h5py.File(weights_path,mode="r")
# k=f.attrs['layer_names']['block1_conv1']
# weigh
f = h5py.File(weights_path)
for k in range(f.attrs['nb_layers']):
# for k in range(f.attrs['layer_names']):
if k >= n_layers :
break
g = f['layer_{}'.format(k)]
weights = [g['param_{}'.format(p)] for p in range(g.attrs['nb_params'])]
model.layers[k].set_weights(weights)
f.close()
When I call this function,it showed this error.
I don't know how to handle it,please!
The text was updated successfully, but these errors were encountered:
import h5py
import os
import numpy as np
def loadWeightsPartial( model , weights_path , n_layers ):
# f=h5py.File(weights_path,mode="r")
# k=f.attrs['layer_names']['block1_conv1']
# weigh
f = h5py.File(weights_path)
for k in range(f.attrs['nb_layers']):
# for k in range(f.attrs['layer_names']):
if k >= n_layers :
break
g = f['layer_{}'.format(k)]
weights = [g['param_{}'.format(p)] for p in range(g.attrs['nb_params'])]
model.layers[k].set_weights(weights)
f.close()
When I call this function,it showed this error.
I don't know how to handle it,please!
The text was updated successfully, but these errors were encountered: