zfit / phasespace

Phase space generation implemented in TensorFlow
https://phasespace.rtfd.io
BSD 3-Clause "New" or "Revised" License
24 stars 9 forks source link

not compatible with TF 2.0 #33

Closed ShyamB97 closed 4 years ago

ShyamB97 commented 4 years ago

Hi, i am trying to run the phasespace example in the documentation and when using phasespace.nbody_decay I get the error:

TypeError: convert_to_tensor_v2() got an unexpected keyword argument 'preferred_dtype'

ShyamB97 commented 4 years ago

Hi again, I managed to find a fix as it seems phasespace.py requires tensorflow v1 but I had tensorflow v2. all i did was replace

import tensorflow as tf

to

import tensorflow.compat.v1 as tf tf.disable_v2_behavior()

i.e. disabled v2 behaviour and re-assign tf to the v1 module.

jonas-eschle commented 4 years ago

Hi, this is in fact correct, we did not (yet) update the requirements or the package. I'll keep this issue open therefore

jonas-eschle commented 4 years ago

Closing, issue addressed in #34