tengshaofeng / ResidualAttentionNetwork-pytorch

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

Errors when I try to run train.py #40

Open puppy2000 opened 2 years ago

puppy2000 commented 2 years ago

I follow the insturction and run: CUDA_VISIBLE_DEVICES=0 python train.py but I get TypeError: empty() received an invalid combination of arguments - got (tuple, dtype=NoneType, device=NoneType), but expected one of:

what's wrong with this code?

chendi77 commented 2 years ago

Did you find the solution?

Surayuth commented 2 years ago

Edit ResidualBlock in basic_layers.py by replacing all / with //. For example, in line 16, you should write as

self.conv1 = nn.Conv2d(input_channels, output_channels//4, 1, 1, bias = False)