Indeed that does solve it. I am going to look at this solution to understand it further.
Thank you.
However, I guess my model is not properly setup.
New error now:
        lambda x, rv_x: -rv_x.log_prob(x)

    AttributeError: 'Tensor' object has no attribute 'log_prob'

This is the loss function as defined here:
 negloglik = lambda x, rv_x: -rv_x.log_prob(x)

I am sorry for asking so many questions. Its pretty hard to find examples of VAE not using the mnist dataset and even less information on VAEs with the probability library of tensorflow.
Searching this issue, I found this 1.