Private Copilot 几年前看Andrej Karpathy写的RNN教程的时候,就有些工作在用RNN做代码生成。我还记得刚看到这种工作的时候觉得这也太离谱了。果然,作为普通人,不出意外地又一次错误判断了事物的发展。才几年的时间,大家的普遍认知已经转变成,“代码生成是对于LLM来说相对比较简单的任务” ¯\_(ツ)_/¯
Making Accompaniment for Guitar Solo on Mac I recently found out a solution to get the accompaniment to my phone, so that I can play along with it. There are some quality-wise compromises but overall it is good enough for me.
A PyTorch GPU Memory Leak Example I ran into this GPU memory leak issue when building a PyTorch training pipeline. After spending quite some time, I finally figured out this minimal reproducible example. Kicking off the training, it shows constantly increasing allocated GPU memory. This “AverageMeter” has been used in many popular repositories (e.g., https://github.com/facebookresearch/moco). It’s by-design tracking the average of […]
Header-only JPEG Save/Load 部署项目的时候偶尔会遇到这类需求,不能使用OpenCV之类的库来读写图片,比如需要部署到嵌入式环境之类的。网上找了一阵,发现对于jpeg的读写,这两个库很方便。
MXNet C++ Deployment iOS上的Deployment的sample code, https://github.com/pppoe/WhatsThis-iOS, 介绍: http://haoxiang.org/2016/01/ios-mxnet-demo/ MXNet训练得到的模型有两个文件,XX.json描述网络,XX.params存网络参数。部署的时候最方便的方式是用Amalgamation: https://github.com/apache/incubator-mxnet/tree/master/amalgamation Amalgamation可以把整个MXNet里Prediction相关的代码写到一个很大的C源文件,部署的时候只需要这个C源文件和对应的一个头文件就可以了。 Sample code 在这里 https://github.com/pppoe/mxnet-Cpp-Deployment-Wrapper-Demo
mxnet里im2rec的坑 用了一下mxnet,感觉速度上确实比Tensorflow快不少。之前试过部署到Moible端[LINK],也挺方便的。 mxnet训练的时候可以通过ImageDataIter从预处理过的rec文件里读图。rec基本上就是一个打包了label和image的大文件。用rec文件配合DataIter做训练,GPU利用率很高。 遇到两个问题,废了些时间。 1.用im2rec.py生成rec的时候,输入文件格式是,图片序号+Label+图片路径。之间必须用\t分隔,不然会有奇怪的报错。 2.im2rec.py生成图片的时候是用OpenCV读的图,然后从BGR转RGB。图读出来是HxWxC,需要转成CxHxW。不然结果自然会差很多。