- Python出现
bound method。
方法没加()
PermissionError: [Errno 13] Permission denied: '...\data\\input\\dev.csv'
dev.csv这个文件打开了
- RunTime Error: RuntimeError: Given groups=1, weight of size [32, 1, 7, 7], expected input [1, 4, 110, 84] to have 1 channels, but got 4 channels instead
模型权值的尺寸为[32, 1, 7, 7]这个尺寸表示的意思是[output channel, input channel, height of kernel, width of kernel],但是输入的特征图的尺寸是[1, 4, 110, 84],即[batch_size, input channel, height of feature map, width of feature map]。期望的input channel是1,但输入进来的是4.
解决办法:该表网络的定义变成[32, 4, 7, 7]或者对输入特征图进行处理变成[1, 1, 110, 84]
本文探讨了在使用Python进行深度学习时遇到的模型权重通道数与输入特征图通道数不匹配的问题。具体表现为模型期待1通道输入,而实际输入为4通道。文章提供了两种解决方案:一是调整模型权重为[32,4,7,7];二是预处理输入特征图,将其转换为[1,1,110,84]。
4358

被折叠的 条评论
为什么被折叠?



