AI模型优化
君宝bob
这个作者很懒,什么都没留下…
展开
-
RuntimeError: 1only batches of spatial targets supported (3D tensors) but got 4
【代码】RuntimeError: 1only batches of spatial targets supported (3D tensors) but got 4。翻译 2022-09-07 20:32:01 · 1892 阅读 · 0 评论 -
float 转fp16(half())调试踩坑记录
模式1. 训练阶段将barc 模型转换为fp16,以减少显存开销。模式2. 推理阶段直接将权重转换为fp16/int8。2.加载预训练权重,修改为half。1.修改model.half()pytoch常见错误。原创 2022-08-22 16:40:48 · 1381 阅读 · 0 评论