Sum of values accessed through numpy memmap is wrong
numpy.memmap is for treating raw data in a file as a numpy array.  Your filename is 'file.npy', so that is not "raw" data.  It is a NPY file, which has a header containing meta-information about the array stored in it.
To memory-map a NPY file, use the mmap_mode argument of numpy.load().
I have a large (9.3 GB) .npy file containing a uint8 values in an (67000, 9, 128, 128) ndarray. I created it using np.save() and when loading it using x = np.memmap('file.npy', "uint8", shape=(67000, 9, 128, 128), mode="r"), np.sum(x[0,0,:,0]) returns 13783. The "problem" is that when I try loading it with np.load("file.npy") and run the same function, I get the sum to 13768.
Since np.load() loads the whole file in memory, I'd assume that the sum computed on its ndarray is correct, while the one returned by the ndarray loaded with memmap is wrong, but why are they different ? If it was a reading error the sum should be really off, so why is it off by only 15 ??! 
I have no clue why that is the case. This won't affect my computation per say but it could be significant for other tasks.