Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssertionError when running basenji_test.py and basenji_sad.py #69

Closed
pkathail opened this issue Sep 14, 2020 · 2 comments
Closed

AssertionError when running basenji_test.py and basenji_sad.py #69

pkathail opened this issue Sep 14, 2020 · 2 comments

Comments

@pkathail
Copy link

Hi David,

I'm running into the following error (pasted below) when running basenji_test.py or basenji_sad.py on the sample data provided in the tutorials.
This is the command I'm running for basenji_sad: python basenji_sad.py --cpu -f /global/scratch/poojakathail/data/hg19.ml.fa -o /global/scratch/poojakathail/output/rfx6_sad --rc --shift "1,0,-1" -t /global/scratch/poojakathail/data/heart_wigs.txt /global/scratch/poojakathail/models/params_small.json /global/scratch/poojakathail/models/heart/model_best.tf /global/scratch/poojakathail/data/rs339331.vcf

params_small.json is the file provided here: https://github.com/calico/basenji/blob/master/tutorials/models/params_small.json
model_best.tf is the pre-trained model included in the tutorials

Thanks for providing this package and for your help!

  File "basenji_sad.py", line 419, in <module>
    main()
  File "basenji_sad.py", line 176, in main
    seqnn_model.restore(model_file)
  File "/global/home/users/poojakathail/basenji/basenji/seqnn.py", line 316, in restore
    self.model.load_weights(model_file)
  File "/global/home/users/poojakathail/.conda/envs/basenji/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/training.py", line 182, in load_weights
    return super(Model, self).load_weights(filepath, by_name)
  File "/global/home/users/poojakathail/.conda/envs/basenji/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/network.py", line 1356, in load_weights
    status.assert_nontrivial_match()
  File "/global/home/users/poojakathail/.conda/envs/basenji/lib/python3.7/site-packages/tensorflow_core/python/training/tracking/util.py", line 966, in assert_nontrivial_match
    return self.assert_consumed()
  File "/global/home/users/poojakathail/.conda/envs/basenji/lib/python3.7/site-packages/tensorflow_core/python/training/tracking/util.py", line 943, in assert_consumed
    "".join(unused_attribute_strings)))
AssertionError: Some objects had attributes which were not restored:
@davek44
Copy link
Contributor

davek44 commented Oct 21, 2020

Hi, I apologize--I haven't updated the SAD tutorial to the new tensorflow 2 code and models. Right now, you're mixing a parameters file from tf2 with an older model from tf1. The scripts all work, so I'm happy to give you advice about how to use them. In the meantime, I'll prioritize updating that jupyter tutorial.

@pkathail
Copy link
Author

I was able to get it working by using an older version of the repo and the files provided in the tutorial -- thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants