Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#define OPERATOR clamp(in,(FLOAT4)(1.00000e-12f),(FLOAT4)(inff)) #1977

Open
PanJinquan opened this issue Jan 4, 2024 · 0 comments
Open

#define OPERATOR clamp(in,(FLOAT4)(1.00000e-12f),(FLOAT4)(inff)) #1977

PanJinquan opened this issue Jan 4, 2024 · 0 comments

Comments

@PanJinquan
Copy link

测试发现,转换Pytorch的normalize函数存在问题: y=torch.nn.functional.normalize(x, p=1, dim=1)
转换ONNX,opset_version=9,可以正常转换,但在推理时出现异常:

#pragma OPENCL EXTENSION cl_khr_fp16 : enable ^ <kernel>:73:18: error: use of undeclared identifier 'inff' FLOAT4 out = OPERATOR; ^ <built-in>:28:59: note: expanded from here #define OPERATOR clamp(in,(FLOAT4)(1.00000e-12f),(FLOAT4)(inff))
image

从问题看,是未能识别字符inff导致的异常,而正常情况下,无穷大应该表示为:inf,而不是inff
于是尝试改动tnnproto文件,将normalize层inf改为in,推理则正常了
image
我怀疑,TNN源码是不多加了f导致出现inff异常

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant