![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
pytorch
_小马奔腾
这个作者很懒,什么都没留下…
展开
-
Pytorch奇技淫巧
如何打印pytorch模型的参数名与权重import torchimport torch.nn as nnnet = nn.Linear(5,5)for name,parameters in net.named_parameters(): print(name,':',parameters.size()) print(getattr(net,name))#################### print ######################weight : tor原创 2020-05-12 10:12:59 · 389 阅读 · 0 评论 -
Transformer与OCR
由于OCR是序列到序列,NMT或者通用的任务Transformer也是Sequence 2 Sequence。而OCR识别经典论文是CRNN,其中是CNN+RNN+softmax,这个RNN可以试试LSTM,GRU,或者其他变种。也可以是机器翻译的端到端的序列识别。本文试图分析Transformer与OCR任务,试图将Transformer替换CRNN中的LSTMLSTM与TransformerTransformer实际上是google的论文『attention is all you need』.原创 2020-05-10 20:11:37 · 1536 阅读 · 0 评论 -
TensorRT 安装与使用及Pytorch的TensorRT部署
Tensorrt安装原创 2020-03-23 19:23:15 · 12020 阅读 · 4 评论 -
Pytorch RuntimeError: The size of tensor a (4) must match the size of tensor b (3) at non-singleton
Pytorch 的坑以及记录最近在训练pytorch用到DataLoader自己复写了一个dataset,有个奇怪的问题,训练时候报这个(Pytorch RuntimeError: The size of tensor a (4) must match the size of tensor b (3) at non-singleton)错误解决办法把 img = Image.open(...原创 2019-11-17 17:27:34 · 41505 阅读 · 14 评论