随笔分类 -  Pytorch

摘要:mmdetection中的Focal loss计算流程 - 知乎 阅读全文
posted @ 2025-02-28 14:50 Picassooo 阅读(1) 评论(0) 推荐(0) 编辑
摘要:【python函数】torch.nn.Embedding函数用法图解-CSDN博客 import torch import torch.nn as nn embedding = nn.Embedding(10, 3) # 10表示num_embeddings, 3表示embedding_dim。用标 阅读全文
posted @ 2025-01-07 20:55 Picassooo 阅读(19) 评论(0) 推荐(0) 编辑
摘要:PyTorch 源码解读之 BN & SyncBN:BN 与 多卡同步 BN 详解 - 知乎 阅读全文
posted @ 2025-01-02 11:25 Picassooo 阅读(10) 评论(0) 推荐(0) 编辑
摘要:详解PyTorch FSDP数据并行(Fully Sharded Data Parallel)-CSDN博客 阅读全文
posted @ 2024-12-08 11:51 Picassooo 阅读(28) 评论(0) 推荐(0) 编辑
摘要:gradient_accumulation_steps --梯度累加理解_gradient accumulation step-CSDN博客 阅读全文
posted @ 2024-12-08 11:23 Picassooo 阅读(44) 评论(0) 推荐(0) 编辑
摘要:示例: import torch box = torch.tensor([[[0.1000, 0.2000, 0.5000, 0.3000], [0.6000, 0.6000, 0.9000, 0.9000], [0.1000, 0.1000, 0.2000, 0.2000]], [[0.1000, 阅读全文
posted @ 2024-10-26 12:30 Picassooo 阅读(45) 评论(0) 推荐(0) 编辑
摘要:转:PyTorch关于以下方法使用:detach() cpu() numpy() 以及item()_output.cpu().detach()-CSDN博客 阅读全文
posted @ 2024-10-17 16:51 Picassooo 阅读(31) 评论(0) 推荐(0) 编辑
摘要:Pytorch dataloader中的num_workers (选择最合适的num_workers值)_dataloader的numworkers-CSDN博客 阅读全文
posted @ 2024-10-16 14:34 Picassooo 阅读(8) 评论(0) 推荐(0) 编辑
摘要:第一步:模型训练 用下面的代码训练一个简单的模型:(数据集参考:利用pytorch的datasets在本地读取MNIST数据集进行分类) import torch import torch.nn as nn import torch.optim as optim from torchvision i 阅读全文
posted @ 2024-10-12 14:11 Picassooo 阅读(101) 评论(0) 推荐(0) 编辑
摘要:Pytorch中的register_buffer()_registerbuffer-CSDN博客 阅读全文
posted @ 2024-08-15 09:42 Picassooo 阅读(9) 评论(0) 推荐(0) 编辑
摘要:详解torch.nn.functional.grid_sample函数:可实现对特征图的水平/垂直翻转_gridsample-CSDN博客 (对F.grid_sample的含义讲解的比较清楚) 一文彻底弄懂 PyTorch 的 `F.grid_sample`_pytorch grid sample- 阅读全文
posted @ 2024-08-06 16:52 Picassooo 阅读(525) 评论(0) 推荐(0) 编辑
摘要:示例: import torch h, w = 3, 5 x_ = torch.arange(w).unsqueeze(0).expand(h, -1) # torch.Size([h, w]) # expand(*size)函数可以实现对张量中单维度上数据的复制操作。 # 其中,*size分别指定 阅读全文
posted @ 2024-08-06 16:34 Picassooo 阅读(72) 评论(0) 推荐(0) 编辑
摘要:PyTorch 中的 expand 函数用于扩展张量的形状,使其在某些维度上“看起来”像被复制了多次,但实际上它不会复制数据,从而节省内存和计算资源。扩展后的张量共享原始张量的内存空间,因此原始张量和扩展后的张量是同一个数据的视图。 以下是 torch.expand 函数的一些基本用法: 1. 扩展 阅读全文
posted @ 2024-07-15 09:22 Picassooo 阅读(817) 评论(0) 推荐(0) 编辑
摘要:推理模型部署(一):ONNX runtime 实践 - 知乎 (zhihu.com) (推荐,有从零构建一个小onnx模型的示例) ONNX简介-CSDN博客 (推荐) 深度学习模型转换与部署那些事(含ONNX格式详细分析) (bindog.github.io) (推荐) Pytorch导出ONNX 阅读全文
posted @ 2024-07-05 09:04 Picassooo 阅读(3587) 评论(0) 推荐(0) 编辑
摘要:推荐:MMDetection框架入门教程(五):Runner和Hook详细解析_epochbasedrunner/iterbasedrunner-CSDN博客 以下内容摘自上面的博文: Runner又称执行器,负责模型训练过程的调度,主要目的是让用户使用更少的代码以及灵活可配置的方式开启训练。换句话 阅读全文
posted @ 2024-02-21 09:35 Picassooo 阅读(115) 评论(0) 推荐(0) 编辑
摘要:PyTorch 模型性能分析——PyTorch Profiler - 简书 (jianshu.com) 【pytorch】profiler tutorials - 知乎 (zhihu.com) pytorch profiler 性能分析 demo - 知乎 (zhihu.com) 阅读全文
posted @ 2024-02-19 10:17 Picassooo 阅读(235) 评论(0) 推荐(0) 编辑
摘要:PyTorch常用代码段 阅读全文
posted @ 2024-01-11 18:39 Picassooo 阅读(4) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示