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

Unable to train joint model from pretrained cpg and dna model with tensorflow backend #28

Open
snajder-r opened this issue Aug 30, 2019 · 1 comment

Comments

@snajder-r
Copy link

Hi,

I was able to train the joint model successfully. Then I wanted to train the cpg and dna model separately and the joint model on top. Training cpg and dna model worked fine, but I started having problems when trying to train the joint model from the two pretrained models.

The error I got was:

tensorflow.python.framework.errors_impl.FailedPreconditionError: Attempting to use uninitialized value cpg/bidirectional_1/forward_gru_1/bias
	 [[{{node cpg/bidirectional_1/forward_gru_1/bias/read}}]]

I found that the cause was in dcpg_train.py in get_callbacks:

if K._BACKEND == 'tensorflow' and not opts.no_tensorboard:
    K.set_session(K.tf.Session(config=K.tf.ConfigProto(
        intra_op_parallelism_threads=1,
        inter_op_parallelism_threads=1)))

I don't have too much experience with tensorflow or Keras, but it looks to me that setting a new session causes the model to lose the loaded weights. Since this is only done when tensorboard is used, I was able to workaround the problem by running with --no_tensorboard.

Best,
Rene

@cangermueller
Copy link
Owner

cangermueller commented Aug 31, 2019 via email

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