tensorflow / probability

Probabilistic reasoning and statistical analysis in TensorFlow
https://www.tensorflow.org/probability/
Apache License 2.0
4.24k stars 1.09k forks source link

conditional sampling from PixelCNN docstring code error #746

Closed skeydan closed 4 years ago

skeydan commented 4 years ago

Hi,

PixelCNN is awesome, thanks for that!

However running the conditional sampling example

https://github.com/tensorflow/probability/blob/7286a995fe682e0a2d94a169584e50f7fe655111/tensorflow_probability/python/distributions/pixel_cnn.py#L200

fails with

InvalidArgumentError: cannot compute Equal as input #1(zero-based) was expected to be a float tensor but is a int32 tensor [Op:Equal]

(from assertion in

https://github.com/tensorflow/probability/blob/495da0add37bd5f894653cf860b7db1de4666e28/tensorflow_probability/python/distributions/pixel_cnn.py#L494

)

It would be great if the docstring could be updated :-) Thanks!!

skeydan commented 4 years ago

Hey, I shouldn't probably have put "docstring" in the title as this probably made it sound like I could just as well have sent a PR :-)

Actually I looked at the source quickly but really didn't have much time last Friday, and was also thinking that for you it'd probably be a matter of 2 minutes...

Background is, I wanted to add a test for PixelCNN and then just went with unconditional ,-) But having it work in conditional mode would make for a nice blog post :-)

I can also try to find the time but if anyone else would be interested to fix it it would be great :-)

Thanks Sigrid

csuter commented 4 years ago

+@emilyfertig to comment

emilyfertig commented 4 years ago

Thanks for catching this, Sigrid! Happy conditional image generating :)

skeydan commented 4 years ago

thanks a lot for the quick fix!! :-)