RuntimeError: set_sizes_contiguous is not allowed on a Tensor created from .data or .detach()

报错:

File “/opt/crnn/lib/dataset.py”, line 141, in loadData
v.data.resize_(data.size()).copy_(data)
RuntimeError: set_sizes_contiguous is not allowed on a Tensor created from .data or .detach()

原因:版本的问题
解决方法:将
f_label.data.resize_(data.size()).copy_(data)

替换成

f_label.resize_(data.size()).copy_(data)

猜你喜欢

转载自blog.csdn.net/qq_45100200/article/details/134076926
今日推荐