![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
SakuraiShota
这个作者很懒,什么都没留下…
展开
-
rosbag 报错‘utf-8‘ codec can‘t decode byte 0xff in position 1
如图代码,使用rosbag读取,read_messages时报错’utf-8’ codec can’t decode byte 0xff in position 1:invalid start byte。解决方法:更换python版本,即可,不再出现错误。原创 2023-05-06 00:13:13 · 316 阅读 · 0 评论 -
获取pytorch神经网络中间输出结果-resnet
首先print(model)获取网络各个层的详细信息,如下(本文例子选取开源稀疏神经网络库sparsezoo中95%稀疏度的50层resnet,关于该库可参见本人另一篇博客):ResNet( (input): _Input( (conv): Conv2d(3, 64, kernel_size=(7, 7), stride=(2, 2), padding=(3, 3), bias=False) (bn): BatchNorm2d(64, eps=1e-05, momentum=0.1,原创 2022-04-26 15:40:56 · 2821 阅读 · 0 评论 -
高度稀疏化神经网络模型(sparsezoo, sparseml, neuralmagic)
利用github上的neuralmagic/sparseml,训练高度稀疏化神经网络,可以得到高效的模型进行研究。首先参考https://sparsezoo.neuralmagic.com/?domain=nlp&sub_domain=sentiment_analysis&page=1得到想要的模型,cv的训练过程:图像分类:from torchvision.models import resnet50from torch.nn import Linearfrom spar原创 2022-04-19 14:52:42 · 4213 阅读 · 0 评论 -
ubuntu编译pytorch源码报错${PYTHON_VERSION_STRING}找不到
使用ubuntu编译pytorch源码时,在外部库的cmakeLists文件中,如 IF(${PYTHON_VERSION_STRING} VERSION_LESS 3.4) # ---[ Python < 3.4 does not natively support enums, and needs a polyfill SET(PEACHPY_PYTHONPATH "${PYTHON_SIX_SOURCE_DIR}:${PYTHON_ENUM_SOURCE_DIR}:${PYTH原创 2022-03-23 01:24:45 · 2184 阅读 · 0 评论