Dahan Gong
Dahan Gong
呃这两天有别的事情,还没看多久,晚上我再自己测测
能贴你的 prune_by_class_bisenetv2.py 吗?我创建 `lib/models/bisenetv2.py#BiSeNetV2(19)`后 `graph.build_graph` 没跑过去。bisnet 是刚从 https://github.com/CoinCheung/BiSeNet 找的。
markdown的多行代码块语法是 三个 ``` ` ``` 连着表示开头和结尾,比如 ``` # // 开头 # ``` [ + 空格 + 语言名] # 具体内容 # // 结尾 # ``` ```
你用的 bisenetv2.py 是哪个文件?BiSeNet-master/lib/models/bisenetv2.py 还是 BiSeNet-master/old/bisenetv2/bisenetv2.py ? 另外我用官方仓库的模型(old/README.md的百度网盘文件 model_final.pth)好像加载不了,大概是参数不一致……厚颜来要你的原始模型了,能发的话,网盘或者发到 [email protected] 都行;不方便的话,我就再看看。我现在因为懒得自己在coco上训 练,缺少实际可用的参数张量,卡在前边某一个分组卷积的 `cut_analysis` 步骤了Orz
嗯谢谢!
@jzy-hxf 抱歉之前没注意消息。具体到你这个问题,是torch版本比较新(1.11还是多少以上)造成的。你把这个项目里出现的 `_retain_param_name` 都去掉就行了,不影响结果。
@GeneralJing 抱歉我好久没注意这个。我确认了几遍代码,应该是 `examples/torchpruner/prune_by_class.py` 写的有问题,每次执行 `torchpruner.set_cut` 后 `graph` 的部分信息会过时,所以需要重新创建 `graph`。`graph.modules` 是稳定的,可以预先算好 keys ``` python for key in list(graph.modules): # ... model, context = torchpruner.set_cut(model, result) graph = torchpruner.ONNXGraph(model) # 本行可以省略 graph.build_graph(inputs=(torch.zeros(1,...
呃大概是: ``` json { "已知要剪枝的张量": { "被剪维度 | any": [ ["受影响的张量1", "影响到的维度1"], ["受影响的张量2", "影响到的维度2"] ] } } ``` 影响到的维度也要跟着剪掉对应通道
呃没测过训练,单纯用torchpruner是可以发现并剪的。
The `src/tim/vx/internal/src/ops/vsi_nn_op_bidirectional_sequence_lstm.c` needs updates to make Bidi-LSTM easier to use. Since the `internal` folder refuses direct PRs, I'll open a new issue (#401) to describe my updates.