マニホールド学習法を使用して、次元を縮小して RGB 画像をグレーにしようとしています。
画像を numpy 配列 (image_array) に変換しました
import numpy as np
from sklearn.datasets import load_sample_image
china = load_sample_image("china.jpg")
# Convert to floats instead of the default 8 bits integer coding. Dividing by
# 255 is important so that plt.imshow behaves works well on float data (need to
# be in the range [0-1]
china = np.arraychina, dtype=np.float64) / 255
# Load Image and transform to a 2D numpy array.
w, h, d = original_shape = tuple(china.shape)
assert d == 3
image_array = np.reshape(china, (w * h, d))
image_array を調べる
image_array.shape
(273280、3)
しようとすると、
X, color = image_array
私は得る
ValueError: アンパックする値が多すぎます。
これを回避する方法はありますか?