in notebook feature_columns.ipynb : Coursera | Online Courses & Credentials From Top Educators. Join for Free | Coursera
when I run cell :
photo_count = feature_column.numeric_column(‘PhotoAmt’)
demo(photo_count)
I get the error :
AttributeError: module ‘keras._tf_keras.keras.layers’ has no attribute ‘DenseFeatures’
I am using imports :
import numpy as np
import pandas as pd
import tensorflow as tf
from tensorflow import feature_column
from tensorflow.keras import layers
from sklearn.model_selection import train_test_split
print(tf.version)
I am using tensorflow version : 2.17.0
Is it linked to warning at the beginning of the notebook ?
Warning: The tf.feature_columns
module described in this tutorial is not recommended for new code. Keras preprocessing layers cover this functionality, for migration instructions see the Migrating feature columns guide. The tf.feature_columns
module was designed for use with TF1 Estimators
. It does fall under our compatibility guarantees, but will receive no fixes other than security vulnerabilities.
So what should I do ? replace tf.feature_columns by : Classifier les données structurées à l'aide des couches de prétraitement Keras | TensorFlow Core
Or should I use tf1.keras.layers.DenseFeatures : Classifier les données structurées à l'aide des couches de prétraitement Keras | TensorFlow Core ?
Thank you for your help