Closed shivahanifi closed 2 weeks ago
The checkpoints saved in the from of .0.index
and .0.data-00000-of-00001
store the model's weights but not the full architecture or configuration. This is a common output format when using TensorFlow's checkpointing system. These files are saved in this way because:
.data-00000-of-00001
format. The .index
file holds metadata about the saved weights, while .data
files hold the actual parameter data.
h5_model_path = os.path.join(checkpoint_path, "model.h5")
model.save(h5_model_path)
Using the following code I saved the model.h5 format and was able to visualize the architecture in the wandb. wandb report
artifact = wandb.Artifact(name = wandb.run.name, type = "model")
ckp_files = os.listdir(checkpoint_path)
for ckp in ckp_files:
full_path = os.path.join(checkpoint_path, ckp)
artifact.add_file(local_path=full_path, name=ckp)
# Save the model as .h5 file
h5_model_path = os.path.join(checkpoint_path, f"{ckp}_model.h5")
model.save(h5_model_path)
artifact.save()
wandb.save(os.path.join(checkpoint_path, "*"))
pip install netron
and then
import netron
netron.start("path_to_model.h5")
Closing the issue. Follow in issue #17
Model saved in a correct format should be easily visualized by clicking on it in wandb using Netron
https://community.wandb.ai/t/how-to-visualize-model-graph-in-weights-and-biases/2547
Netron supports the following file formats:
Netron also supports custom formats through extensions