runtimeerror: output 0 of unbindbackward is a view and is being modified inplace.
程序员文章站
2022-03-04 14:17:27
...
portch ResNet 中间层可视化出现的错误记录
主要原因:
调用了make_grid()
根因:
Lib\site-packages\torchvision\utils.py
74 行 for t in tensor:
改成
for idx, _ in enumerate([jj for jj in tensor]):
t = tensor[idx]
有些说是下面这种,其实也不对
for i in range(tensor.size(0)): # loop over mini-batch dimension
t = tensor[i]
【参考】
推荐阅读
-
RuntimeError: Output 0 of UnbindBackward is a view and is being modified inplace.
-
runtimeerror: output 0 of unbindbackward is a view and is being modified inplace.
-
RuntimeError: Output 0 of SelectBackward is a view and is being modified inplace.
-
RuntimeError: Output 0 of UnbindBackward is a view and is being modified inplace.