Skip to content

Commit

Permalink
Update keras.js
Browse files Browse the repository at this point in the history
  • Loading branch information
lutzroeder committed Dec 20, 2022
1 parent b28f474 commit 9ffbdf8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/keras.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,11 @@ keras.ModelFactory = class {
const moduleName = group.attributes.has('name') ? group.attributes.get('name') : group.name;
for (const variableGroup of group.groups.values()) {
if (variableGroup.attributes.size !== 0 || variableGroup.groups.size !== 0) {
throw new keras.Error('Variable format is not HDF5 Weights');
throw new keras.Error('Variable format is not HDF5 Weights.');
}
const variable = variableGroup.value;
if (!variable) {
throw new keras.Error('Variable value is not HDF5 Weights');
throw new keras.Error('Variable value is not HDF5 Weights.');
}
const name = moduleName ? [ moduleName, variableGroup.name ].join('/') : moduleName.name;
const tensor = new keras.Tensor(name, variable.shape, variable.type, null, variable.littleEndian, variable.type === 'string' ? variable.value : variable.data);
Expand Down Expand Up @@ -200,7 +200,7 @@ keras.ModelFactory = class {
weights.add(moduleName, tensor);
return;
}
throw new keras.Error('Module group format is not HDF5 Weights');
throw new keras.Error('Module group format is not HDF5 Weights.');
};
walk(weights_group);
return openModel(format, '', '', null, weights);
Expand Down

0 comments on commit 9ffbdf8

Please sign in to comment.