tensorflow / lattice

Lattice methods in TensorFlow

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with gast

josem789 opened this issue · comments

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!

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.

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.

I face the same issue in

Tensorflow 2.4.1
gast 0.4.0

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