pedropro / TACO

🌮 Trash Annotations in Context Dataset Toolkit
http://tacodataset.org
MIT License
603 stars 201 forks source link

Help getting a .hd5f file with model architecture and weights #49

Open Skmadigan opened 2 years ago

Skmadigan commented 2 years ago

Thank you for this repository! I am using the pre-trained weights downloaded here, and it looks like the .h5 file has only the weights and not the model architecture. Is there a way to extract the model architecture from the weights? I've tried the code below, but it just prints "None" for the model configuration. Is there a place I could find a generic config.json file for the Mask-RCNN architecture and somehow merge the weights with it?

from tensorflow import keras

import h5py
f = h5py.File('mask_rcnn_taco_0100.h5', 'r')
print(f.attrs.get('model_config'))