Criar uma DNN usando a API funcional do Keras avaliações

11046 avaliações

Dinesh S. · Revisado há about 1 year

Yemil V. · Revisado há about 1 year

Ganeswara P. · Revisado há about 1 year

Ashok K. · Revisado há about 1 year

Joao M. · Revisado há about 1 year

Camilo Ernesto V. · Revisado há about 1 year

Christopher D. · Revisado há about 1 year

Martin L. · Revisado há about 1 year

Odar M. · Revisado há about 1 year

Harsh B. · Revisado há about 1 year

Issues with defining features: def features_and_labels(row_data):     for unwanted_col in ['pickup_datetime', 'key']:         row_data.pop(unwanted_col)     label = row_data.pop(LABEL_COLUMN)     return row_data, label  # features, label # load the training data def load_dataset(pattern, batch_size=1, mode=tf.estimator.ModeKeys.EVAL):   dataset = (tf.data.experimental.make_csv_dataset(pattern, batch_size, CSV_COLUMNS, DEFAULTS)              .map(features_and_labels) # features, label              )   if mode == tf.estimator.ModeKeys.TRAIN:         dataset = dataset.shuffle(1000).repeat()   dataset = dataset.prefetch(1) # take advantage of multi-threading; 1=AUTOTUNE   return dataset ---------------------------------------------------------------------------AttributeError Traceback (most recent call last) Cell In[11], line 8 5 return row_data, label # features, label 7 # load the training data----> 8 def load_dataset(pattern, batch_size=1, mode=tf.estimator.ModeKeys.EVAL): 9 dataset = (tf.data.experimental.make_csv_dataset(pattern, batch_size, CSV_COLUMNS, DEFAULTS) 10 .map(features_and_labels) # features, label 11 ) 12 if mode == tf.estimator.ModeKeys.TRAIN:AttributeError: module 'tensorflow' has no attribute 'estimator' --------------- Per Gemini - this worked The tf.estimator module is outdated and no longer the recommended way to build models in TensorFlow. It's been largely superseded by Keras, which provides a more user-friendly and flexible API for building and training models. Here's how you can update your code to use Keras instead of tf.estimator: ------- # ... (your features_and_labels function remains the same) # Load the training data using tf.data.Dataset def load_dataset(pattern, batch_size=1, mode='eval'): # Use strings for mode dataset = (tf.data.experimental.make_csv_dataset(pattern, batch_size, CSV_COLUMNS, DEFAULTS) .map(features_and_labels) # features, label ) if mode 1 == 'train': dataset = dataset.shuffle(1000).repeat() dataset = dataset.prefetch(1) # take advantage of multi-threading; 1=AUTOTUNE return dataset ----- mode parameter: Instead of using tf.estimator.ModeKeys, we'll simply use strings like 'train' or 'eval' to represent the mode. No tf.estimator: We've removed the dependency on tf.estimator altogether.

Rod M. · Revisado há about 1 year

Great Lab!

Francisco A. · Revisado há about 1 year

Ioana B. · Revisado há about 1 year

Thomas N. · Revisado há about 1 year

David L. · Revisado há about 1 year

Ronny d. · Revisado há about 1 year

Anderson I. · Revisado há about 1 year

good

Nikhitha K. · Revisado há about 1 year

David O. · Revisado há about 1 year

敬源 黃. · Revisado há about 1 year

Harry M. · Revisado há about 1 year

Sakshi Nagare .. · Revisado há about 1 year

ok

Raul H. · Revisado há about 1 year

ok

Raul H. · Revisado há about 1 year

Víctor P. · Revisado há about 1 year

Não garantimos que as avaliações publicadas sejam de consumidores que compraram ou usaram os produtos. As avaliações não são verificadas pelo Google.