rknn-toolkit2
rknn-toolkit2 copied to clipboard
int64数据类型转出rknn报错
使用onnx模型转出rknn模型时,包含int64的数据类型,且代码已更新到最新版本,转的过程中报了“Unsupport tyep bits 64 ”
@tongwei0828 hi, have you solved the problem?
请问问题解决了吗
请问问题解决了吗
解决了,我记得我是改onnx把他的数据类型改成了int32就可以了
请问是强行修改吗?我的代码里会用到tensor作为索引然后需要把索引转成int64,但是我知道索引肯定不会超过int32,只是torch强行要求IndexError: tensors used as indices must be long, byte or bool tensors,所以不知道有没有什么好办法能解决这个问题
是的,我这里也不会超过int32,我是改的onnx里的type,你可以搜一下怎么修改onnx file ---- 回复的原邮件 ---- | 发件人 | @.> | | 发送日期 | 2023年12月19日 20:24 | | 收件人 | rockchip-linux/rknn-toolkit2 @.> | | 抄送人 | tongwei0828 @.>, Mention @.> | | 主题 | Re: [rockchip-linux/rknn-toolkit2] int64数据类型转出rknn报错 (Issue #107) |
请问是强行修改吗?我的代码里会用到tensor作为索引然后需要把索引转成int64,但是我知道索引肯定不会超过int32,只是torch强行要求IndexError: tensors used as indices must be long, byte or bool tensors,所以不知道有没有什么好办法能解决这个问题
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>
没事,有偿不需要了,我也记不是太清楚,python 安装onnx包,可以获取每一个节点的名称及各种属性,有一个op type对应的是算子的类型,你搜搜类似的博客还挺多的,就是“修改onnx节点” ---- 回复的原邮件 ---- | 发件人 | @.> | | 发送日期 | 2023年12月19日 20:41 | | 收件人 | rockchip-linux/rknn-toolkit2 @.> | | 抄送人 | tongwei0828 @.>, Mention @.> | | 主题 | Re: [rockchip-linux/rknn-toolkit2] int64数据类型转出rknn报错 (Issue #107) |
能否加个联系方式探讨一下呢?有偿,谢谢!18571108689
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>
可以查看模型中是否有计算index的代码行的数据类型指定为了int64,如果有的话需要为计算过程为float,index过程为int64