错误信息如下:
Traceback (most recent call last):
File "main.py", line 643, in
main()
File "main.py", line 389, in main
avg_train_time = train(train_loader, model, criterion, optimizer, epoch, logger, scheduler)
File "main.py", line 471, in train
prec1, prec5 = accuracy(output.data, target, topk=(1, 5))
File "main.py", line 631, in accuracy
correct_k = correct[:k].view(-1).float().sum(0, keepdim=True)
RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.
您好,非常欣赏您的idea,所以尝试跑一下您的分类模型。 我下载了ImageNet2012数据集之后,尝试启动您的模型,遇到了以下问题,想请教一下是否我的哪些设置出错了?
错误信息如下: Traceback (most recent call last): File "main.py", line 643, in
main()
File "main.py", line 389, in main
avg_train_time = train(train_loader, model, criterion, optimizer, epoch, logger, scheduler)
File "main.py", line 471, in train
prec1, prec5 = accuracy(output.data, target, topk=(1, 5))
File "main.py", line 631, in accuracy
correct_k = correct[:k].view(-1).float().sum(0, keepdim=True)
RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.