我遇到了一些使我感到困惑的问题,我正在VB.NET上使用CheckedListBox属性,我期望的是表单加载CheckedListBox加载并显示之前已检查过的数据库中的数据。
mysql数据库的表模式:
idTable |诠释
项目| Varchar
CheckedStatus | TinyInt(0/1)
这是我的试用代码:
class Residual(nn.Module):
#set the number ofinput and output for each layer
def __init__(self, numIn, numOut):
super(Residual, self).__init__()
self.numIn = numIn
self.numOut = numOut
self.bn = nn.BatchNorm2d(self.numIn)
self.relu = nn.ReLU(inplace = True)
self.conv1 = nn.Conv2d(self.numIn, int(self.numOut / 2), bias = True, kernel_size = 1)
self.bn1 = nn.BatchNorm2d(int(self.numOut / 2))
self.conv2 = nn.Conv2d(int(self.numOut / 2), int(self.numOut / 2), bias = True, kernel_size = 3, stride = 1, padding = 1)
self.bn2 = nn.BatchNorm2d(int(self.numOut / 2))
self.conv3 = nn.Conv2d(int(self.numOut / 2), self.numOut, bias = True, kernel_size = 1)
if self.numIn != self.numOut:
self.conv4 = nn.Conv2d(self.numIn, self.numOut, bias = True, kernel_size = 1)
但这会导致错误:“对象引用未设置为对象的实例”
在CheckedListBox中显示的预期结果是:
[x] Item1
[] Item2
[] Item3
[x] Item4
请给我一些答案或给我一些建议。谢谢