basenji
basenji copied to clipboard
Access to Older Versions of the Model
Hi!
Thank you so much for making all of your code available on github, we really appreciate it. I noticed that there has been a few changes on this repository, particularly with the model architecture. I would greatly appreciate it if I can gain access to the older versions of the model. We are trying to use the older parameters file to restore the model, but it fails to do so as the newer model is in the .h5 format. Hence we would like access to the older human model files, human_model_model_best.tf.meta, human_model_model_best.tf.index, and human_model_model_best.tf.data-00000-of-00001
Thank you very much for all your help in this regard, Faiz
The tf1 branch here https://github.com/calico/basenji/tree/tf1 should do the job. Let me know if it still isn't working for you, and I can help track down the issue. I also have a script to convert to the new tf.keras format if that would be helpful.
Thank you so much from your prompt response!! Is it possible to get the script for to convert to the new tf.keras format? Thank you very much!
First, pull the latest code from master and tf1 branches. It's a little tricky because you have to run two steps with two different tensorflow versions. I have two anaconda environments, that I'll use to demonstrate.
conda activate tf2
save_model.py params_tf2.json model_tf2.h5
conda activate tf1
upgrade_tf1.py params_tf1.txt model_tf1.txt model_tf2.h5
You'll have to manually create the params_tf2.json file. You can follow my transition from https://github.com/calico/basenji/blob/tf1/manuscripts/biorxiv2019/params.txt to https://github.com/calico/basenji/blob/master/manuscripts/biorxiv2019/params_human.json. If you need a hand, you can post it, and I'll help.
Sorry, that doesn't quite work. Pull the latest code and switch to the following.
conda activate tf2
save_model.py params_tf2.json . model_tf2.h5
conda activate tf1
upgrade_tf1.py params_tf1.txt model_tf1.tf model_tf2.h5