1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] Getting an error "AttributeError: module 'tensorflow.python.distribute.input_lib' has...

Discussão em 'Python' iniciado por Stack, Abril 7, 2025.

  1. Stack

    Stack Membro Participativo

    After running the code

    train(train_data, EPOCHS)


    i'm getting error "AttributeError: module 'tensorflow.python.distribute.input_lib' has no attribute 'DistributedDatasetInterface'"

    and after traching the error, it points at line 15--> of

    def train(data, EPOCHS):
    # Loop through epochs
    for epoch in range(1, EPOCHS+1):
    print('\n Epoch {}/{}'.format(epoch, EPOCHS))
    progbar = tf.keras.utils.Progbar(len(data))

    # Creating a metric object
    r = Recall()
    p = Precision()

    # Loop through each batch
    for idx, batch in enumerate(data):
    # Run train step here
    loss = train_step(batch)
    yhat = siamese_model.predict(batch[:2]) #<--- line 15
    r.update_state(batch[2], yhat)
    p.update_state(batch[2], yhat)
    progbar.update(idx+1)
    print(loss.numpy(), r.result().numpy(), p.result().numpy())

    # Save checkpoints
    if epoch % 10 == 0:
    checkpoint.save(file_prefix=checkpoint_prefix)

    Continue reading...

Compartilhe esta Página