Pythonでローカルの.matデータファイルをインポートする場合、常に正しいデータが取得できるとは限りません。
問題のコードは次のとおりです:
1 2 3 4 5 6 | from numpy import *import scipy.io
mnist_train = 'D:\Machine Learning\TensorFlow\Softmax Regression\mnist_dataset\mnist_train.mat' mnist_train_labels = 'D:\Machine Learning\TensorFlow\Softmax Regression\mnist_dataset\mnist_train_labels.mat' x = scipy.io.loadmat(mnist_train)
label = scipy.io.loadmat(mnist_train_labels)
print (x.shape)
|
ログイン後にコピー
上記のコードの出力結果は(1,1)であり、対応するデータは(60000,784)であるはずです。このとき、直接出力する場合は、対応するコード行を追加します。
りー
以上がPythonで.matファイルが正しく読み込めない問題の解決方法を詳しく解説の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。