Comments (11)
valid_places.push_back(paddle::lite_api::Place{TARGET(kHost), PRECISION(kFloat)}); 试试?
from paddle-lite.
valid_places.push_back(paddle::lite_api::Place{TARGET(kHost), PRECISION(kFloat)}); 试试?
感谢,成功奏效了,又产生了新的问题:
/usr/include/clc/image/image.h:19:24: note: passing argument to parameter 'image' here
input.cl:480:31: error: passing '__write_only image2d_t' to parameter of incompatible type '__read_only image2d_t'
input.cl:38:28: note: expanded from macro 'WRITE_IMG_TYPE'
input.cl:36:24: note: expanded from macro '
_WRITE_IMG_TYPE'
/usr/include/clc/image/image.h:19:24: note: passing argument to parameter 'image' here
input.cl:483:31: error: passing '__write_only image2d_t' to parameter of incompatible type '__read_only image2d_t'
input.cl:38:28: note: expanded from macro 'WRITE_IMG_TYPE'
input.cl:36:24: note: expanded from macro '
_WRITE_IMG_TYPE'
/usr/include/clc/image/image.h:19:24: note: passing argument to parameter 'image' here
input.cl:486:31: error: passing '__write_only image2d_t' to parameter of incompatible type '__read_only image2d_t'
input.cl:38:28: note: expanded from macro 'WRITE_IMG_TYPE'
input.cl:36:24: note: expanded from macro '
_WRITE_IMG_TYPE'
/usr/include/clc/image/image.h:19:24: note: passing argument to parameter 'image' here
input.cl:550:31: error: passing '__write_only image2d_t' to parameter of incompatible type '__read_only image2d_t'
input.cl:38:28: note: expanded from macro 'WRITE_IMG_TYPE'
input.cl:36:24: note: expanded from macro '
_WRITE_IMG_TYPE'
from paddle-lite.
valid_places.emplace_back(
Place{TARGET(kOpenCL), PRECISION(kFP16), DATALAYOUT(kImageDefault)});
valid_places.emplace_back(
Place{TARGET(kOpenCL), PRECISION(kFP16), DATALAYOUT(kImageFolder)});
valid_places.emplace_back(
Place{TARGET(kOpenCL), PRECISION(kFloat), DATALAYOUT(kNCHW)});
valid_places.emplace_back(
Place{TARGET(kOpenCL), PRECISION(kAny), DATALAYOUT(kImageDefault)});
valid_places.emplace_back(
Place{TARGET(kOpenCL), PRECISION(kAny), DATALAYOUT(kImageFolder)});
valid_places.emplace_back(
Place{TARGET(kOpenCL), PRECISION(kAny), DATALAYOUT(kNCHW)});
valid_places.emplace_back(
Place{TARGET(kOpenCL), PRECISION(kInt32), DATALAYOUT(kNCHW)});
valid_places.emplace_back(Place{TARGET(kARM)});
from paddle-lite.
你设置一下这些 Place,替换掉 demo 中现有的,跑下试试
from paddle-lite.
替换掉后依然出现如下错误。WRITE_IMG_TYPE(CL_DTYPE_CHAR, output, (int2)(pos_x, pos_y), out);
}E0325 09:45:10.467700 2910 cl_runtime.cc:351] OpenCL error with code CL_BUILD_PROGRAM_FAILURE happened in file /home/lixianrui/Paddle-Lite/lite/backends/opencl/cl_runtime.cc at line 351. Exiting.
F0325 09:45:10.467792 2910 cl_runtime.cc:357] Program build error: input.cl:1:9: warning: #pragma once in main file
input.cl:249:39: error: passing '__write_only image2d_t' to parameter of incompatible type '__read_only image2d_t'
input.cl:38:28: note: expanded from macro 'WRITE_IMG_TYPE'
input.cl:36:24: note: expanded from macro '
_WRITE_IMG_TYPE'
/usr/include/clc/image/image.h:19:24: note: passing argument to parameter 'image' here
input.cl:389:39: error: passing '__write_only image2d_t' to parameter of incompatible type '__read_only image2d_t'
input.cl:38:28: note: expanded from macro 'WRITE_IMG_TYPE'
input.cl:36:24: note: expanded from macro '
_WRITE_IMG_TYPE'
/usr/include/clc/image/image.h:19:24: note: passing argument to parameter 'image' here
input.cl:460:31: error: passing '__write_only image2d_t' to parameter of incompatible type '__read_only image2d_t'
input.cl:38:28: note: expanded from macro 'WRITE_IMG_TYPE'
input.cl:36:24: note: expanded from macro '
_WRITE_IMG_TYPE'
/usr/include/clc/image/image.h:19:24: note: passing argument to parameter 'image' here
input.cl:478:31: error: passing '__write_only image2d_t' to parameter of incompatible type '__read_only image2d_t'
input.cl:38:28: note: expanded from macro 'WRITE_IMG_TYPE'
input.cl:36:24: note: expanded from macro '
_WRITE_IMG_TYPE'
/usr/include/clc/image/image.h:19:24: note: passing argument to parameter 'image' here
input.cl:480:31: error: passing '__write_only image2d_t' to parameter of incompatible type '__read_only image2d_t'
input.cl:38:28: note: expanded from macro 'WRITE_IMG_TYPE'
input.cl:36:24: note: expanded from macro '
_WRITE_IMG_TYPE'
/usr/include/clc/image/image.h:19:24: note: passing argument to parameter 'image' here
input.cl:483:31: error: passing '__write_only image2d_t' to parameter of incompatible type '__read_only image2d_t'
input.cl:38:28: note: expanded from macro 'WRITE_IMG_TYPE'
input.cl:36:24: note: expanded from macro '
_WRITE_IMG_TYPE'
/usr/include/clc/image/image.h:19:24: note: passing argument to parameter 'image' here
input.cl:486:31: error: passing '__write_only image2d_t' to parameter of incompatible type '__read_only image2d_t'
input.cl:38:28: note: expanded from macro 'WRITE_IMG_TYPE'
input.cl:36:24: note: expanded from macro '
_WRITE_IMG_TYPE'
/usr/include/clc/image/image.h:19:24: note: passing argument to parameter 'image' here
input.cl:550:31: error: passing '__write_only image2d_t' to parameter of incompatible type '__read_only image2d_t'
input.cl:38:28: note: expanded from macro 'WRITE_IMG_TYPE'
input.cl:36:24: note: expanded from macro '
_WRITE_IMG_TYPE'
/usr/include/clc/image/image.h:19:24: note: passing argument to parameter 'image' here
from paddle-lite.
替换掉后依然出现如下错误。WRITE_IMG_TYPE(CL_DTYPE_CHAR, output, (int2)(pos_x, pos_y), out); }E0325 09:45:10.467700 2910 cl_runtime.cc:351] OpenCL error with code CL_BUILD_PROGRAM_FAILURE happened in file /home/lixianrui/Paddle-Lite/lite/backends/opencl/cl_runtime.cc at line 351. Exiting. F0325 09:45:10.467792 2910 cl_runtime.cc:357] Program build error: input.cl:1:9: warning: #pragma once in main file input.cl:249:39: error: passing '__write_only image2d_t' to parameter of incompatible type '__read_only image2d_t' input.cl:38:28: note: expanded from macro 'WRITE_IMG_TYPE' input.cl:36:24: note: expanded from macro ' _WRITE_IMG_TYPE' /usr/include/clc/image/image.h:19:24: note: passing argument to parameter 'image' here input.cl:389:39: error: passing '__write_only image2d_t' to parameter of incompatible type '__read_only image2d_t' input.cl:38:28: note: expanded from macro 'WRITE_IMG_TYPE' input.cl:36:24: note: expanded from macro ' _WRITE_IMG_TYPE' /usr/include/clc/image/image.h:19:24: note: passing argument to parameter 'image' here input.cl:460:31: error: passing '__write_only image2d_t' to parameter of incompatible type '__read_only image2d_t' input.cl:38:28: note: expanded from macro 'WRITE_IMG_TYPE' input.cl:36:24: note: expanded from macro ' _WRITE_IMG_TYPE' /usr/include/clc/image/image.h:19:24: note: passing argument to parameter 'image' here input.cl:478:31: error: passing '__write_only image2d_t' to parameter of incompatible type '__read_only image2d_t' input.cl:38:28: note: expanded from macro 'WRITE_IMG_TYPE' input.cl:36:24: note: expanded from macro ' _WRITE_IMG_TYPE' /usr/include/clc/image/image.h:19:24: note: passing argument to parameter 'image' here input.cl:480:31: error: passing '__write_only image2d_t' to parameter of incompatible type '__read_only image2d_t' input.cl:38:28: note: expanded from macro 'WRITE_IMG_TYPE' input.cl:36:24: note: expanded from macro ' _WRITE_IMG_TYPE' /usr/include/clc/image/image.h:19:24: note: passing argument to parameter 'image' here input.cl:483:31: error: passing '__write_only image2d_t' to parameter of incompatible type '__read_only image2d_t' input.cl:38:28: note: expanded from macro 'WRITE_IMG_TYPE' input.cl:36:24: note: expanded from macro ' _WRITE_IMG_TYPE' /usr/include/clc/image/image.h:19:24: note: passing argument to parameter 'image' here input.cl:486:31: error: passing '__write_only image2d_t' to parameter of incompatible type '__read_only image2d_t' input.cl:38:28: note: expanded from macro 'WRITE_IMG_TYPE' input.cl:36:24: note: expanded from macro ' _WRITE_IMG_TYPE' /usr/include/clc/image/image.h:19:24: note: passing argument to parameter 'image' here input.cl:550:31: error: passing '__write_only image2d_t' to parameter of incompatible type '__read_only image2d_t' input.cl:38:28: note: expanded from macro 'WRITE_IMG_TYPE' input.cl:36:24: note: expanded from macro ' _WRITE_IMG_TYPE' /usr/include/clc/image/image.h:19:24: note: passing argument to parameter 'image' here
#ifdef DEBUG
printf("in_c:%d, in_w:%d, in_nh:%d ===> in(%d,%d): %.2f %.2f %.2f %.2f\n",
in_c,
in_w,
in_nh,
pos_x,
in_nh,
in.x,
in.y,
in.z,
in.w);
#endif
const int index =
in_n * size_batch + in_c * size_block + in_h * in_width + in_w;
out[index] = convert_uchar_sat(in.x);
if (C - 4 * in_c >= 2) {
out[index + size_ch] = convert_uchar_sat(in.y);
}
if (C - 4 * in_c >= 3) {
out[index + size_ch * 2] = convert_uchar_sat(in.z);
}
if (C - 4 * in_c >= 4) {
out[index + size_ch * 3] = convert_uchar_sat(in.w);
}
}
__kernel void image2d_default_to_image2d_folder(__read_only image2d_t input,
__write_only image2d_t output,
__private const int in_img_w,
__private const int in_img_h) {
const int pos_x = get_global_id(0);
const int pos_y = get_global_id(1);
CL_DTYPE4 in =
READ_IMG_TYPE(CL_DTYPE_CHAR, input, SAMPLER, (int2)(pos_x, pos_y));
CL_DTYPE4 in0 = 0.f;
CL_DTYPE4 in1 = 0.f;
CL_DTYPE4 in2 = 0.f;
CL_DTYPE4 in3 = 0.f;
in0 = READ_IMG_TYPE(CL_DTYPE_CHAR, input, SAMPLER, (int2)(pos_x * 4, pos_y));
if (pos_x * 4 + 1 < in_img_w) {
in1 = READ_IMG_TYPE(
CL_DTYPE_CHAR, input, SAMPLER, (int2)(pos_x * 4 + 1, pos_y));
}
if (pos_x * 4 + 2 < in_img_w) {
in2 = READ_IMG_TYPE(
CL_DTYPE_CHAR, input, SAMPLER, (int2)(pos_x * 4 + 2, pos_y));
}
if (pos_x * 4 + 3 < in_img_w) {
in3 = READ_IMG_TYPE(
CL_DTYPE_CHAR, input, SAMPLER, (int2)(pos_x * 4 + 3, pos_y));
}
CL_DTYPE4 out = (CL_DTYPE4)(in0.x, in1.x, in2.x, in3.x);
WRITE_IMG_TYPE(CL_DTYPE_CHAR, output, (int2)(pos_x, pos_y), out);
}
__kernel void image2d_folder_to_image2d_default(__read_only image2d_t input,
__write_only image2d_t output,
__private const int out_img_w,
__private const int out_img_h) {
const int pos_x = get_global_id(0);
const int pos_y = get_global_id(1);
CL_DTYPE4 in =
READ_IMG_TYPE(CL_DTYPE_CHAR, input, SAMPLER, (int2)(pos_x, pos_y));
CL_DTYPE4 out0 = 0.f;
CL_DTYPE4 out1 = 0.f;
CL_DTYPE4 out2 = 0.f;
CL_DTYPE4 out3 = 0.f;
out0.x = in.x;
out1.x = in.y;
out2.x = in.z;
out3.x = in.w;
WRITE_IMG_TYPE(CL_DTYPE_CHAR, output, (int2)(pos_x * 4, pos_y), out0);
if (pos_x * 4 + 1 < out_img_w) {
WRITE_IMG_TYPE(CL_DTYPE_CHAR, output, (int2)(pos_x * 4 + 1, pos_y), out1);
}
if (pos_x * 4 + 2 < out_img_w) {
WRITE_IMG_TYPE(CL_DTYPE_CHAR, output, (int2)(pos_x * 4 + 2, pos_y), out2);
}
if (pos_x * 4 + 3 < out_img_w) {
WRITE_IMG_TYPE(CL_DTYPE_CHAR, output, (int2)(pos_x * 4 + 3, pos_y), out3);
}
}
__kernel void image2d_folder_to_buffer(__read_only image2d_t input,
__global MUTABLE_TYPE* output,
__private const int out_h,
__private const int out_w) {
const int pos_x = get_global_id(0);
const int pos_y = get_global_id(1);
CL_DTYPE4 in =
READ_IMG_TYPE(CL_DTYPE_CHAR, input, SAMPLER, (int2)(pos_x, pos_y));
CL_DTYPE4 out = in;
int outpos_base = out_w * pos_y + pos_x * 4;
output[outpos_base] = CONVERT_TYPE_TO(out.x, MUTABLE_TYPE);
if (pos_x * 4 + 1 < out_w) {
output[outpos_base + 1] = CONVERT_TYPE_TO(out.y, MUTABLE_TYPE);
}
if (pos_x * 4 + 2 < out_w) {
output[outpos_base + 2] = CONVERT_TYPE_TO(out.z, MUTABLE_TYPE);
}
if (pos_x * 4 + 3 < out_w) {
output[outpos_base + 3] = CONVERT_TYPE_TO(out.w, MUTABLE_TYPE);
}
}
__kernel void image2d_folder_to_buffer_half2float(__read_only image2d_t input,
__global float* output,
__private const int out_h,
__private const int out_w) {
const int pos_x = get_global_id(0);
const int pos_y = get_global_id(1);
CL_DTYPE4 in =
READ_IMG_TYPE(CL_DTYPE_CHAR, input, SAMPLER, (int2)(pos_x, pos_y));
float4 out = convert_float4(in);
int outpos_base = out_w * pos_y + pos_x * 4;
output[outpos_base] = out.x;
if (pos_x * 4 + 1 < out_w) {
output[outpos_base + 1] = out.y;
}
if (pos_x * 4 + 2 < out_w) {
output[outpos_base + 2] = out.z;
}
if (pos_x * 4 + 3 < out_w) {
output[outpos_base + 3] = out.w;
}
}
__kernel void buffer_to_image2d_folder(__global const MUTABLE_TYPE* input,
__write_only image2d_t output,
__private const int out_h,
__private const int out_w,
__private const int length) {
const int pos_x = get_global_id(0);
const int pos_y = get_global_id(1);
int inpos_base = out_w * pos_y + pos_x * 4;
CL_COMPUTE_DTYPE4 out = (CL_COMPUTE_DTYPE4)(0.f, 0.f, 0.f, 0.f);
out.x = CONVERT_TYPE_TO(input[inpos_base], CL_COMPUTE_DTYPE);
if (inpos_base + 1 < length) {
out.y = CONVERT_TYPE_TO(input[inpos_base + 1], CL_COMPUTE_DTYPE);
}
if (inpos_base + 2 < length) {
out.z = CONVERT_TYPE_TO(input[inpos_base + 2], CL_COMPUTE_DTYPE);
}
if (inpos_base + 3 < length) {
out.w = CONVERT_TYPE_TO(input[inpos_base + 3], CL_COMPUTE_DTYPE);
}
WRITE_IMG_TYPE(CL_DTYPE_CHAR, output, (int2)(pos_x, pos_y), out);
}E0325 09:45:10.467700 2910 cl_runtime.cc:351] OpenCL error with code CL_BUILD_PROGRAM_FAILURE happened in file /home/lixianrui/Paddle-Lite/lite/backends/opencl/cl_runtime.cc at line 351. Exiting.
F0325 09:45:10.467792 2910 cl_runtime.cc:357] Program build error: input.cl:1:9: warning: #pragma once in main file
input.cl:249:39: error: passing '__write_only image2d_t' to parameter of incompatible type '__read_only image2d_t'
from paddle-lite.
这个问题你能整理一下代码提个 PR 看下么
from paddle-lite.
这个问题你能整理一下代码提个 PR 看下么
#10477
已提交PR
from paddle-lite.
看起来是驱动问题导致的运行时编译失败,无法解析 __write_only image2d_t 和 __read_only image2d_t。目前的解决方案是采用opencl buffer版本的code,但是buffer支持的算子不多,不确定能否跑通这个模型。
from paddle-lite.
看起来是驱动问题导致的运行时编译失败,无法解析 __write_only image2d_t 和 __read_only image2d_t。目前的解决方案是采用opencl buffer版本的code,但是buffer支持的算子不多,不确定能否跑通这个模型。
您好,具体指的是opencl的哪个版本及以上那
from paddle-lite.
看起来是驱动问题导致的运行时编译失败,无法解析 __write_only image2d_t 和 __read_only image2d_t。目前的解决方案是采用opencl buffer版本的code,但是buffer支持的算子不多,不确定能否跑通这个模型。
更新了mesa版本,跑通了,感谢
from paddle-lite.
Related Issues (20)
- 树莓派4b上跑自己的nb模型结果图片没有识别框 HOT 7
- 使用经过paddle-lite-opt优化后的模型,在压测环境下报错(fread(dst, 1, size, file_) == size): 0!==262288 Failed to read 262288 bytes. HOT 4
- V4 OCR的检测模型,导出为atlas格式后,无法跑在atlas 300ipro上 HOT 1
- arm的推理结果正确,opencl的结果不正确,请问如何做逐层的精度对比分析? HOT 3
- Object Detection运行run脚本的时候报错 HOT 6
- 华为Atlas300I(3010,昇腾310)安装Paddle-Lite运行例程出错 HOT 4
- Paddle-Lite通过X2Paddle转化出的nb模型出错 HOT 2
- [BUG] sort_cpuid_by_max_freq()中的bubble sort代码逻辑错误 HOT 4
- 基于Paddle Lite框架下的编译问题 HOT 3
- Android端推理LightGlue模型crash了 HOT 1
- ubuntu 22.04 x64 编译paddle-lite x86出错 lite/CMakeFiles/publish_inference.dir/rule HOT 2
- .pdmodel转换.nb失败,报错Check failed: it != outputs_.end(): HOT 18
- 3399 编译with_opencl后运行示例mobilenetv1_light_api显示不支持opencl HOT 1
- 使用华为NPU推理pp-yoloe-r模型报错,提示cann版本不匹配 HOT 15
- could not create a descriptor for a pooling forward propagation primitive HOT 1
- "树莓派5 编译错误"- v2.13 编译报错、环境信息: (Linux raspberrypi 6.6.28+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.28-1+rpt1 (2024-04-22) aarch64 GNU/Linux) HOT 20
- 预编译库的V2,12下载的压缩包里没有找到python,我要怎么继续下一步得到python--->install--->dist--->paddlelite-*.whl HOT 1
- "树莓派5 编译错误"- v2.13 编译报错 cd09a8e01、环境信息:(Debian arm64 ----armv8 ) ,经检查“cd09a8e01”是git describe --always 值 HOT 3
- 编译无法生成inference_lite_lib.armlinux.armv8.opencl包 HOT 5
- Linux x86平台推理Paddle-OCRv4出错
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from paddle-lite.