tensorflow / tensorflow/probability
Problem defining model object in bayesian_vgg.py
Open
@jburnim is already working on this.
Since May 9, 2019.
- Dominant language
- Jupyter Notebook
- Stars
- 4.4k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
Hello all,
my following code
self._input = tf.placeholder(tf.float32, shape=[None, 28, 28, 1])
self._training = tf.placeholder_with_default(False, shape=[])
self._labels = tf.placeholder(tf.float32, shape=[None, 10])
out = self._input
out = tfp.layers.Convolution2DFlipout(6,kernel_size=5,padding="SAME",activation=tf.nn.relu)(out)
out = tf.layers.max_pooling2d(out, pool_size=2, strides=2) # 12
out = tfp.layers.Convolution2DFlipout(16,kernel_size=5,padding="SAME",activation=tf.nn.relu)(out)
out = tf.layers.max_pooling2d(out, pool_size=2, strides=2) # 4
out = tf.contrib.layers.flatten(out)
out = tfp.layers.DenseFlipout(120, activation=tf.nn.relu)(out)
out = tfp.layers.DenseFlipout(84, activation=tf.nn.relu)(out)
out = tfp.layers.DenseFlipout(10)(out)
image = tf.keras.layers.Input(shape=[None, 28, 28, 1], dtype='float32')
model = tf.keras.Model(inputs=image, outputs=out)
returns the following error
Output tensors to a Model must be the output of a TensorFlow
Layer(thus holding past layer metadata). Found: Tensor("dense_flipout_1/BiasAdd:0", shape=(?, 10), dtype=float32)
Anyone has an idea on how to solve that?
Thanks so much
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.
Assessment
This issue has not been assessed yet.