Using LBN with TensorFlow2
I'm having an issue using the LBN packagae (1.0.3
) with tensorflow (2.0.0
) and Python 3.7.4. In the attached minimal example, I create some four-vectors using the create_four_vectors
function in the test.py
file of the repository, generate some random labels, build a simple model, and then attempt to train. The model will compile but fails on the second iteration of training with a message like
TypeError: An op outside of the function building code is being passed a "Graph" tensor. It is possible to have Graph tensors leak out of the function building context by including a tf.init_scope in your function building code. For example, the following function will fail: @tf.function def has_init_scope(): my_constant = tf.constant(1.) with tf.init_scope(): added = my_constant * 2 The graph tensor has name: sequential/lbn_layer/LBN/particles/particle_weights:0
It seems as if something isn't properly connected, but I've been unable to figure out the issue, so any help/insight would be much appreciated. Please let me know if there's any additional information I can provide.