class ghaph_net(nn.Module):
def __int__(self,out_channels=32):
super(ghaph_net,self).__init__()
self.out_channels=out_channels
self.deep_gat = DeepGAT(in_channels=1, hidden_channels=8, out_channels=32, num_layers=3)
self.batch =1
def forward(self,linjie_matrix,point_coord):
edge_index = lil_to_edge_index(linjie_matrix).cuda()
print(self.out_channels)
return self.out_channels
报错AttributeError: 'ghaph_net' object has no attribute 'out_channels',可是我明明定义了这个属性啊
上网查:init两端都得为双下划线__init__
结果:我的没这个问题
后续解决:__int__->__init__
这pycharm自动补全补了个int 也是够无语的