[Python] How to overcome this error? For tensorflow

Discussão em 'Python' iniciado por Stack, Junho 8, 2025.

  1. Stack

    Stack Membro Participativo

    Tensorflow problem. Eager mode problem

    Make CNN and fit the model

    [1]0.35

    Epoch 1/10

    品

    Hunt ImeErron

    Traceback (most recent call last)

    cell in[138], line 1

    1 history model.fit(x_train,y_train, epochs=10,

    A

    validation_data=(x_valid,y_valid))

    R

    File d:\Pythont V.venv\Lib\site-packages\keras\src\utils\traceback utils.py:122, in filter traceback..error_handler(*args, ""kwargs)

    119 filtered to process_traceback_frames (e. traceback)

    120 #To get the full stack trace, call:

    121 #keras.config.disable traceback filtering()"

    ->122

    raise e.with traceback(filtered tb) from None

    123 finally:

    124 del filtered tb

    File d:\Pythonst\venv\lib\site-packages\tensorflow\python\data\ops\dataset_ops.pysses, in Datasetv2_iter_(self)

    501 return iterator_ops.OwnedIterator(self)

    502 else:

    ->503 raise RuntimeError("tf.data.Dataset only supports Python-style "

    584 "iteration in eager mode or within tf.function.")

    Bunt lie Error: tf.data.Dataset only supports Python-style iteration in eager mode or within tf.function.

    Continue reading...

Compartilhe esta Página