3D-ResNets-PyTorch icon indicating copy to clipboard operation
3D-ResNets-PyTorch copied to clipboard

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.

Open shizishen opened this issue 2 years ago • 2 comments

shizishen avatar Feb 28 '23 07:02 shizishen

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

87003697 avatar Feb 28 '23 07:02 87003697

when i run ucf101 by this commond python main.py --root_path /media/lisaiwei/data/working_2023_2_27/Efficient-3DCNNs-master --video_path datasets/UCF101_JPG --annotation_path annotation_ucf101_self/ucf101_01.json --result_path results --dataset ucf101 --model_depth 50 --n_classes 101 --batch_size 8 --n_threads 4 --checkpoint 1 there is an error

run train at epoch 1 Traceback (most recent call last): File "main.py", line 152, in train_logger, train_batch_logger) File "/media/lisaiwei/data/working_2023_2_27/Efficient-3DCNNs-master/train.py", line 34, in train_epoch prec1, prec5 = calculate_accuracy(outputs.data, targets.data, topk=(1,5)) File "/media/lisaiwei/data/working_2023_2_27/Efficient-3DCNNs-master/utils.py", line 67, in calculate_accuracy correct_k = correct[:k].view(-1).float().sum(0) 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.

shizishen avatar Feb 28 '23 07:02 shizishen