python - 连接两个Numpy图像数组时出现问题。引发错误 “only integer scalar arrays can be converted to a scalar index”

标签 python python-3.x numpy opencv

我在一个图像数组中有一些真实图像,而在另一个图像数组中有一些虚假图像。我想附加两个numpy图像阵列来训练我的CNN模型。但是np.concatenate产生错误only integer scalar arrays can be converted to a scalar index
我的真实图像阵列的形状为(30938,3,112,112),我的假图像阵列的形状为(11372,3,112,112),其中每个图像的形状为(3,112,112)

我已经尝试过了 combined=np.concatenate(real,fake,axis=0)
哪里有问题?

最佳答案

只有一个错误

combined=np.concatenate((real,fake),axis=0)

关于python - 连接两个Numpy图像数组时出现问题。引发错误 “only integer scalar arrays can be converted to a scalar index”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56703707/

相关文章:

python - 复数数组上的 scipy cdist 或 pdist

python - 如何从 scikit-learn 解释决策树

python - 自创建模块用于异步导入

python - 在 Python 中使用多个分隔符拆分字符串

Python 无法在位置 0 : character maps to <undefined> 处编码字符 '\u3010'

python - 获取一个参数

python - sklearn中KMeans的变换是否可以逆转?

python - 子进程运行/调用不起作用

python - 使用 zip() 和 join() 等内置 Python 函数对函数性能有何影响?

multidimensional-array - 符号识别,例如 scikit-learn 中的手写数字示例(python)