C2_W4_Lab_2_Signals not running in colab

It is a sparse tensor issue related to dataset windowing.

_fill_in_missing creates dense tensor whereas version at colab requires sparse tensor.
TypeError: Input must be a SparseTensor

Removing _fill_in_missing from
values = [float(_fill_in_missing(value)) for value in values]
to
values = [float(value) for value in values]
gives following error:
TypeError: Failed to convert object of type <class ‘tensorflow.python.framework.sparse_tensor.SparseTensor’> to Tensor.

Please help sort this out.
Regards
Sanjoy

One obvious solution that I had not tried on C2W4 Lab1 and Lab2 was replicating exact versions as used in Coursera notebooks, i.e.

pip install tensorflow==2.3.1
pip install tfx==0.24.0

I did this for C2W4 Lab3 and everything worked perfectly at colab like in Coursera. Now I will do the same for Lab1 and Lab2 and confirm if it works without errors or not.

Regards
Sanjoy

Ran C2W4 Lab1 and Lab2 at colab with the same versions of tf, tfx and tfa. So problem solved.
Thank you for your attention
Regards
Sanjoy

2 Likes