I'm trying to convert a .pkl 4D array into a datastore on MATLAB
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I'm trying to convert a .pkl 4D array into a datastore on MATLAB, so that I can use the datastore to train a convolutional neural network. I have tried converting the .pkl file to a .mat, a .png and a .txt through python, but none have worked. When I try to convert the .mat file to the datastore using the code:
ds = datastore('folderpath', 'FileExtensions', '.mat', 'Type', 'tabularText')
I get the error "Cannot intepret data in the file 'filepath'. Found 3 variable names but 2 data columns. You may need to specifiy a different format, delimiter or number of lines.'
0 commentaires
Réponses (1)
Ayush Modi
le 23 Mai 2024
Hi Hugh,
The tabularText type is intended for reading tabular data from text files, which doesn't match the structure of .mat files containing 4D arrays. For .mat files, you should consider using a fileDatastore. Here is an example to show how you can achieve this:
fds = fileDatastore('filename',"ReadFcn",@load,"FileExtensions",".mat");
data1 = read(fds);
For more information on fileDatastore function, refer to the following MathWorks documentation:
0 commentaires
Voir également
Catégories
En savoir plus sur Classification dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!