yjxiong / tsn-pytorch

Temporal Segment Networks (TSN) in PyTorch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error about epoch print statement when i use the main.py to train with ucf101 dataset

dandingol03 opened this issue · comments

Hi, @yjxiong
I use the main.py script to train ucf101 , but the script encount an error when it ends an epoch. the error as below:

Traceback (most recent call last):
File "main.py", line 307, in
main()
File "main.py", line 130, in main
train(train_loader, model, criterion, optimizer, epoch)
File "main.py", line 206, in train
data_time=data_time, loss=losses, top1=top1, top5=top5, lr=optimizer.param_groups[-1]['lr'])))
TypeError: unsupported format string passed to torch.cuda.FloatTensor.format

After I check the script, it is the print statement makes the programme terminated.
print(('Epoch: [{0}][{1}/{2}], lr: {lr:.5f}\t' 'Time {batch_time.val:.3f} ({batch_time.avg:.3f})\t' 'Data {data_time.val:.3f} ({data_time.avg:.3f})\t' 'Loss {loss.val:.4f} ({loss.avg:.4f})\t' 'Prec@1 {top1.val:.3f} ({top1.avg:.3f})\t' 'Prec@5 {top5.val:.3f} ({top5.avg:.3f})'.format( epoch, i, len(train_loader), batch_time=batch_time, data_time=data_time, loss=losses, top1=top1, top5=top5, lr=optimizer.param_groups[-1]['lr'])))

Thanks in advance~

figure out ,close