TRN-pytorch
TRN-pytorch copied to clipboard
IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number
Run the command :
CUDA_VISIBLE_DEVICES=0,1 python main.py something RGB
--arch BNInception --num_segments 3
--consensus_type TRN --batch-size 64
IT woud be error
Freezing BatchNorm2D except the first one.
Traceback (most recent call last):
File "main.py", line 322, in
the one takes error ubuntu18 + rtx2080ti + cuda10 + cudnn7.4.2 + pytorch 1.0 + python3.6
the other one won't error ubuntu16 + gtx1080ti + cuda8 + cudnn5.1.10 + pytorch 0.3.1 + python3.5
modify main.py line 175-177
#losses.update(loss.data[0], input.size(0))
#top1.update(prec1[0], input.size(0))
#top5.update(prec5[0], input.size(0))
to losses.update(loss.item(), input.size(0)) top1.update(loss.item(), input.size(0)) top5.update(loss.item(), input.size(0))
then won't be error, start the iteration.