0

I'm trying to load two memory mapped files,

temp = numpy.load(currentDirectory + "\\tmp\\temperature.npy", mmap_mode='r')
salinity = numpy.load(currentDirectory + "\\tmp\\salinity.npy", mmap_mode='r')

but Python throws the following error:

IOError: Failed to interpret file 'C:\\my\\file\\path\\..\\tmp\\salinity.npy' as a pickle

When I load either by itself, it works just fine.

The files that are quite large (~500MB), but otherwise I don't think they are notable.

What might the problem be here?

3
  • Does the same thing happen with smaller files? It might help if you show the shape and dtype of these files (when loaded individually). Commented Mar 8, 2016 at 2:31
  • Hi @hpaulj , shape = (1, 102, 720, 1440) and type = float32 . I'll give some smaller files a try and see what happens... Commented Mar 8, 2016 at 2:46
  • Hi @hpaulj it appears to work fine when I have two small files... I wonder if Im running out of memory to interpret the file? Commented Mar 8, 2016 at 2:53

1 Answer 1

1

This works for me. Both files are large than 5GB.

X = np.load(os.path.join(path, '_file1.npy'), mmap_mode='r')
Y = np.load(os.path.join(path, '_file2.npy'), mmap_mode='r')

Which operating system are you using? The problem is not with size of the "npy" files but problem is with "\" in path. change your path as:

path = '/media/gtx1060/DATA/Datasets'
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.