1

I have two NumPy arrays saved in .npy file extension. One contains x_train data and other contains y_train data.

The x_train.npy file is 5.7GB of size. I can't feed it to the training by loading the whole array to the memory.

Every time I try to load it to RAM and train the model, Colab crashes before starting the training.

Is there a way to feed large Numpy files to tf.fit()

files I have:

  • "x_train.npy" 5.7GB
  • "y_train.npy"
4
  • Which is the model? Can it be fitted by batches? Commented Mar 28, 2022 at 10:56
  • It is a Resnet type model for audio. Each input has a size of (16000,1). It can be fitted by batches Commented Mar 28, 2022 at 11:07
  • Then I advise loading it from disk by batches and clearing these from RAM as you iterate over the whole dataset. Commented Mar 28, 2022 at 11:42
  • Can you please recommend a code snippet or an example code? Commented Mar 28, 2022 at 12:30

1 Answer 1

0

Depending on how much RAM your device has, it may not be possible from a hardware point of view.

Sign up to request clarification or add additional context in comments.

1 Comment

I'm using Colab. I think that is 12GB ram. Isn't there any way to work around this? I found this solution link. But it doesn't say how to use y labels

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.