-
[Python] IndexError: invalid index of a 0-dim tensor. Use `tensor.item()` in Python or `tensor.item<T>()` in C++ to convert a 0-dim tensor to a numberSetting & Error 2021. 8. 11. 01:26반응형
파이토치 0.5 이후 버전에서 0차원 텐서의 지수가 유효하지 않아서 발생하는 에러
https://github.com/NVIDIA/flownet2-pytorch/issues/113
invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number · Issue #113 · NVIDIA/flownet2
pytorch 1.0 python3 main.py --inference --model FlowNet2 --save_flow --inference_dataset ImagesFromFolder --inference_dataset_root ~/fs24_512/ --resume mycheckpoints/FlowNet2_checkpoint.pth.tar Ini...
github.com
crit(Variable(predict.log()), Variable(torch.LongTensor([1]))).data[0] 를
crit(Variable(predict.log()), Variable(torch.LongTensor([1]))).data 로 사용하면 됨
반응형'Setting & Error' 카테고리의 다른 글