Pytorch
文章平均质量分 50
tomeasure
一个立志于用编程满足自己吃货欲望的吃货
展开
-
Expected object of scalar type c10::Half but got scalar type float for sequence element 2.
问题Traceback (most recent call last): File "test.py", line 324, in <module> save_conf=opt.save_conf, File "test.py", line 124, in test output = non_max_suppression(inf_out, conf_thres=conf_thres, iou_thres=iou_thres, labels=lb) File "/h原创 2022-01-10 15:24:55 · 2247 阅读 · 0 评论 -
cubin.cu(6): error: identifier “None“ is undefined
问题描述在使用 cupy 编译代码的时候出现一个错误,主要报错内容摘录如下:cupy.cuda.compiler.CompileException: /tmp/tmpawqz6dru/87ee563e031d11ab8d69518c7343833f_2.cubin.cu(6): error: identifier "None" is undefined/tmp/tmpawqz6dru/87ee563e031d11ab8d69518c7343833f_2.cubin.cu(6): error: ide原创 2021-08-23 17:44:30 · 588 阅读 · 0 评论 -
RuntimeError: Unsupported: ONNX export of Slice with dynamic inputs. DynamicSlice is a deprecated ex
问题描述在使用 torch.onnx.export() 将 Pytorch 版 shufflenet v2 转为 onnx 的时候,出现了一个错误。出错代码torch.onnx.export(model, input_example, "{}.onnx".format(modelpath), input_names = None, output_names = None, )报错信息Traceback (most rece原创 2021-04-20 18:04:04 · 4370 阅读 · 5 评论 -
torch.utils.data学习笔记
在 Pytorch 的数据加载工具中,torch.utils.data.DataLoader 类起到核心的作用,它是在数据集上的一个 Python 迭代器,并支持以下内容:Map 与迭代器类型的数据集;自定义的数据加载指令;自动分批;单进程与多进程的数据加载;自动内存pinning 这些选项通过 DataLoader 的构造器的参数进行配置,该类的构造器记为:DataLoader(dataset, batch_size=1, shuffle=False, sampler=None,原创 2021-03-31 17:05:16 · 599 阅读 · 1 评论 -
RuntimeError: Trying to backward through the graph a second time, but the buffers have already been
错误:RuntimeError: Trying to backward through the graph a second time, but the buffers have already been freed. Specify retain_graph=True when calling backward the first time.原因:程序在试图执行backward的时候,发现...原创 2019-05-08 18:21:39 · 32830 阅读 · 18 评论 -
Pytorch检查一个张量是否为空
检查一个pytorch的张量是不是空张量,很简单:if torch_tensor == torch.Size([]): print("this tensor is empty")else: print("this tensor is not empty")原创 2019-05-08 22:43:23 · 17770 阅读 · 4 评论