Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/341.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何为标签塑造图像_Python_Machine Learning_Keras_Keras Layer - Fatal编程技术网

Python 如何为标签塑造图像

Python 如何为标签塑造图像,python,machine-learning,keras,keras-layer,Python,Machine Learning,Keras,Keras Layer,我正在尝试训练卫星图像。我的培训集有两个文件夹,分别是输入(示例)和基本事实(标签) 图像总数为:496 我的X_列车形状是:(496,3256256) y_列车形状为:(49625656) 对于每一个模型,我使用我得到的关于稠密层的错误 ValueError: Expected dense to have 2 dimensions, but got an array with shape (496,256,256) 您正在将图像馈送到稠密层。使用.flatte()展平图像或使用带有CNN层的

我正在尝试训练卫星图像。我的培训集有两个文件夹,分别是输入(示例)和基本事实(标签)

图像总数为:
496

我的X_列车形状是:
(496,3256256)

y_列车形状为:
(49625656)

对于每一个模型,我使用我得到的关于稠密层的错误

ValueError: Expected dense to have 2 dimensions, but got an array with shape (496,256,256)

您正在将图像馈送到稠密层。使用.flatte()展平图像或使用带有CNN层的模型。形状(496,3256256)表示有496张256x256大小的图像,具有3个维度(rgb)

看看这个CNN模型