tensorflow / lattice

Lattice methods in TensorFlow
Apache License 2.0
518 stars 94 forks source link

Issue with gast #66

Closed josem789 closed 3 years ago

josem789 commented 3 years ago

I installed tensorflow lattice with TF 2.3.0 but when trying to run I receive a conversion error and an attribute error "gast has no attribute 'Index'"

I tried to install three versions of tensorflow lattice (0.9.9, 2.0, and 2.0.8) but recieved the same error and I could not install an older version of gast (currently running 0.4.0) due to the dependencies of my current setup.

Please let me know if you have additional recommendations. Thank you!

mmilanifard commented 3 years ago

This might be TF installation/packaging issue, not directly related to TF Lattice. Try this code snippet to see if it triggers the same error (from here):

import tensorflow as tf

def temp(x):
  return tf.shape(x)[0]

tf.autograph.to_graph(temp)

If the above code fails, I suggest reinstalling TF in a clean/new virtual env, or maybe asking about the issue on the main TF repo.

josem789 commented 3 years ago

Thank you, the above code failed. I have seen similar TF-gast issues posted online that may be addressed by installing the nightly build or an older build.

menonnsl commented 3 years ago

I face the same issue in

Tensorflow 2.4.1
gast 0.4.0
innat commented 3 years ago

For tf 2.0 to tf 2.4, use gast == 0.2.2. Otherwise, use tf 2.5 for gast == 0.4.0.