tengshaofeng / ResidualAttentionNetwork-pytorch

a pytorch code about Residual Attention Network. This code is based on two projects from
667 stars 165 forks source link

Error : Data must be sequence , got float #25

Closed Jayant1234 closed 4 years ago

Jayant1234 commented 4 years ago

I am trying to implement a new dataset on this code. I changed the class name and also included data class which gives an image as an item of size 448*448 through each iteration. And there is a list of labels matching the class name list. And I am using from model.residual_attention_network import ResidualAttentionModel_448input as.....

And I am getting this error : Traceback (most recent call last): File "train.py", line 83, in model = ResidualAttentionModel().cuda() File "/home/jayant/Documents/Marsh_Ann/ResidualAttentionNetwork-pytorch-master/model/residual_attention_network.py", line 24, in init self.residual_block0 = ResidualBlock(64, 128) File "/home/jayant/Documents/Marsh_Ann/ResidualAttentionNetwork-pytorch-master/model/basic_layers.py", line 20, in init self.bn3 = nn.BatchNorm2d(output_channels/4) File "/home/jayant/anaconda3/envs/saltmarsh/lib/python3.7/site-packages/torch/nn/modules/batchnorm.py", line 21, in init self.weight = Parameter(torch.Tensor(num_features)) TypeError: new(): data must be a sequence (got float) @tengshaofeng Do you have an intuition about what am I doing wrong? I can also share my dataset rendering class. It has a getiitem method which returns 448*448 image.