ResidualAttentionNetwork-pytorch icon indicating copy to clipboard operation
ResidualAttentionNetwork-pytorch copied to clipboard

Errors when I try to run train.py

Open puppy2000 opened this issue 2 years ago • 2 comments

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:

  • (tuple of ints size, *, tuple of names names, torch.memory_format memory_format, torch.dtype dtype, torch.layout layout, torch.device device, bool pin_memory, bool requires_grad)
  • (tuple of ints size, *, torch.memory_format memory_format, Tensor out, torch.dtype dtype, torch.layout layout, torch.device device, bool pin_memory, bool requires_grad)

what's wrong with this code?

puppy2000 avatar Mar 14 '22 03:03 puppy2000

Did you find the solution?

chendi77 avatar May 28 '22 03:05 chendi77

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)

Surayuth avatar May 31 '22 02:05 Surayuth