添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account 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. #1021 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. #1021 Lss6666 opened this issue Apr 15, 2022 · 2 comments

各位好友们:
我想用HICO数据集重新训练ResNet50 - dcn网络(人体关键点136个)。
但是当我运行python /data/open_mmlab/frames/AlphaPose/scripts/train.py --cfg /data/open_mmlab/frames/AlphaPose/configs/halpe_136/resnet/256x192_res50_lr1e-3_2x-dcn-combined.yaml时,出现以下问题:
Traceback (most recent call last):
File "/data/open_mmlab/frames/AlphaPose/scripts/train.py", line 345, in
main()
File "/data/open_mmlab/frames/AlphaPose/scripts/train.py", line 292, in main
loss, miou = train(opt, train_loader, m, criterion, optimizer, writer)
File "/data/open_mmlab/frames/AlphaPose/scripts/train.py", line 96, in train
loss.backward()
File "/workspace/miniconda3/envs/alps/lib/python3.7/site-packages/torch/tensor.py", line 221, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph)
File "/workspace/miniconda3/envs/alps/lib/python3.7/site-packages/torch/autograd/ init .py", line 132, in backward
allow_unreachable=True) # allow_unreachable flag
File "/workspace/miniconda3/envs/alps/lib/python3.7/site-packages/torch/autograd/function.py", line 89, in apply
return self._forward_cls.backward(self, *args) # type: ignore
File "/workspace/miniconda3/envs/alps/lib/python3.7/site-packages/torch/autograd/function.py", line 210, in wrapper
outputs = fn(ctx, *args)
File "/data/open_mmlab/frames/AlphaPose/alphapose/models/layers/dcn/deform_conv.py", line 110, in backward
cur_im2col_step)
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.
有一种解决方式是根据 cezannec/capsule_net_pytorch#4
找出view()这个函数,在前面用上. reshape or a call to .contiguous()
但是deform_conv_cuda.cpp中的view()函数很多,不知道从何下手。
希望能和大家一起讨论交流,谢谢各位的解答!