In order to use the Tf.data.Dataset.from_tensor_slices method, do I need to have GPU on the PC?

Asked

Viewed 16 times

1

I’m doing my tensorflow training. So far so good:

data = numpy.random.random((1000, 32))
labels = numpy.random.random((1000, 10))
model.fit(data, labels, epochs=10, batch_size=32)

But when I do practice like this it makes a mistake:

data = numpy.random.random((1000, 32))
labels = numpy.random.random((1000, 10))
dataset = tf.data.Dataset.from_tensor_slices((data, labels))
dataset = dataset.batch(32)
model.fit(dataset, epochs=10)

Error appears StartAbort Out of range at each time:

Epoch 1/10
     32/Unknown - 1s 25ms/step - loss: 219.6890 - accuracy: 0.11002020-04-17 11:42:58.024503: W tensorflow/core/common_runtime/base_collective_executor.cc:216] BaseCollectiveExecutor::StartAbort Out of range: End of sequence
     [[{{node IteratorGetNext}}]]
32/32 [==============================] - 1s 25ms/step - loss: 219.6890 - accuracy: 0.1100

Help me, please! I’m new at tensorflow and also here, don’t be too hard on me.

  • The answer to the title is no, the body error that is a different problem can be learned in the answer already given and likada above.

  • Thanks @Maniero, but I’m still going to keep looking because I didn’t create anything manually. I am only using the methods already created by following the official tutorial at https://www.tensorflow.org/guide/keras/overview?hl=pt_br

  • I recommend using Keras directly https://keras.io/

  • Thanks @Annamaule. I’ll try this approach.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.