Hi,
This is my code and the error I get when I use “from_tensor_slice”. Anyone knows the solution (Keras clear_output doesn’t help)?
import tensorflow as tf 
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from sklearn.model_selection import train_test_split

tf.compat.v1.disable_eager_execution()

df = pd.read_csv('insurance.csv')
X = pd.get_dummies(df, columns = ['sex', 'smoker', 'region'])
y = X.pop('charges')

ds = tf.data.Dataset.from_tensor_slices((X.values, y.values))

The error:
Traceback (most recent call last):
File “C:\Users\User\AppData\Local\Programs\Python\Python36\lib\site-
packages\tensorflow\python\training\tracking\tracking.py”, line 269, in del
File “C:\Users\User\AppData\Local\Programs\Python\Python36\lib\site-
packages\tensorflow\python\framework\ops.py”, line 4011, in as_default
AttributeError: ‘NoneType’ object has no attribute ‘get_controller’