0

I have saved spectrograms as mat files in MATLAB. However, when I train a pix2pix model with my own .mat data, it stopped after a while with this error:

ValueError: Did not fully consume compressed contents of an miCOMPRESSED element. This can indicate that the .mat file is corrupted.

I have read that the version of the .mat file can be a cause of this problem. How can I fix that?

save(['E:\matlab\speech\data\',strcat(int2str(1)),'.mat'],'img_A');

This is my code for saving spectrogram as mat file.

Adriaan
  • 17,741
  • 7
  • 42
  • 75
yunyang
  • 43
  • 4
  • [`save(filename,variable,'version')`](https://mathworks.com/help/matlab/ref/save.html#btox10b-1-version) syntax allows you to save as a different version. – Adriaan Sep 12 '19 at 13:20
  • Thanks, i saved it in '-v6' 。However,I found that by choosing '-v6' to store data, all mat files are the same size.This is not the case with V7 or v7.3. Is this normal? – yunyang Sep 13 '19 at 07:59
  • If your variables in MATLAB contain the same amount of elements (e.g. all matrices are 100x100) then yes. Otherwise probably not. You can check what goes into the mat files, and see whether those are the same size, and can you at least load them into your Python program now? – Adriaan Sep 13 '19 at 08:44
  • Yes, it can be load into my python program. Maybe I resize the data so that the data size is the same. – yunyang Sep 13 '19 at 15:01
  • Have you encountered this with tensorflow? E tensorflow/stream_executor/cuda/cuda_driver.cc:1177] could not synchronize on CUDA context: CUDA_ERROR_ILLEGAL_ADDRESS :: No stack trace available F tensorflow/core/common_runtime/gpu/gpu_util.cc:370] GPU sync failed – yunyang Sep 13 '19 at 15:03

0 Answers0