tensorflow / tensorflow/probability
With TF 2.0 preview, "old-style" variational layers error with "Inputs to eager execution function cannot be Keras symbolic tensors"
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 4.4k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I have unit tests for Convolution1DReparameterization , Convolution1DReparameterization etc. that basically look like this
x = tf.ones(shape = [150,1])
y = tf.ones(shape = [150])
model = tf.keras.Sequential(
[tfpl.DenseReparameterization(
units = 512,
activation = "relu"),
tfpl.DenseReparameterization(
units = 1)])
model.compile(optimizer = 'adam', loss = "mse")
model.fit(x, y, steps_per_epoch = 1)
These run fine with TF 1, but with TF 2 preview I get
_SymbolicException: Inputs to eager execution function cannot be Keras symbolic tensors, but found [<tf.Tensor 'sequential/dense_reparameterization/divergence_kernel:0' shape=() dtype=float32>, <tf.Tensor 'sequential/dense_reparameterization_1/divergence_kernel:0' shape=() dtype=float32>]
Would you happen to know what is the cause here?
Are these "old-style" variational layers supposed to run with TF 2?
Many thanks in advance!!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the provided tf.keras.Sequential reproducer using DenseReparameterization and the existing unit tests for the variational layers. Run it with the TensorFlow 2 preview and compare the eager-execution failure with TensorFlow 1 behavior. Done means the old-style layers have a verified TensorFlow 2 outcome and the relevant tests pass or clearly capture the supported behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- keras, tensorflow
- Domain
- machine-learning, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100