pytorch编程
xqlily
这个作者很懒,什么都没留下…
展开
-
RuntimeError: index out of range at ..\aten\src\TH/generic/THTensorEvenMoreMath.cpp:193
python编程语言pytorch框架的一个读取图像数据集的程序,在运行的时候,其中把图像的标签数字转化为onehot编码的语句报错,该语句如下: torch.sparse.torch.eye(NUM_CLASSES).index_select(dim=0, index=label) 报错如下: RuntimeError: index out of range at ..\aten\src\TH/generic/THTensorEvenMoreMath.cpp:193 这因为label= -1造成的原创 2020-10-21 19:14:58 · 1637 阅读 · 0 评论 -
RuntimeError: CUDA out of memory.
Win10运行环境,python编程语言,运行一个pytorch框架的程序报错 “RuntimeError: CUDA out of memory. Tried to allocate 98.00 MiB (GPU 0; 8.00 GiB total capacity; 4.39 GiB already allocated; 5.27 MiB free; 89.58 MiB cached)”,解决办法: bachsize的参数值减小就解决了,举个例子:这里的主机运行内存是16GB,程序ba...原创 2020-09-27 12:17:07 · 496 阅读 · 0 评论