cannot reshape array of size 99 into shape (99,1,2)
时间: 2024-01-19 22:03:19 浏览: 148
This error occurs when you are trying to reshape an array into a shape that is not compatible with its size.
In this case, you are trying to reshape an array of size 99 into a shape of (99, 1, 2). This means you want to create an array with 99 rows, 1 column and 2 depth dimensions.
However, this is not possible because the original array only has a size of 99 elements, which means it can only be reshaped into a shape that has a total of 99 elements.
To fix this error, you need to choose a different shape that is compatible with the size of your array. For example, you could reshape the array into a shape of (33, 3, 1) or (9, 11, 1).
相关问题
cannot reshape array of size 3740000 into shape (3)
这个错误提示意味着你正在尝试将一个大小为 3740000 的数组重新调整为一个大小为 3 的数组,这是不可能的。
可能的原因是你正在使用 numpy 的 reshape 函数时传入了错误的参数。你可以检查一下你的代码,确认你正在正确使用 reshape 函数并且传入的目标形状是正确的。
另外,你也可以检查一下你的数据是否正确加载或处理,因为数据的维度可能会影响 reshape 函数的使用。
ValueError: cannot reshape array of size 2 into shape (2,2)
这个错误通常是由于你尝试将一个大小为2的numpy数组调整为2×2的形状时引起的。这可能是在使用reshape()函数进行操作时出现的错误。在执行reshape()之前,您应该确保原始数组的大小与要调整的形状相匹配。如果您想让我提供更多关于这个问题的帮助,请提供更多上下文信息。
阅读全文