how to feed uint8 data using userbuffer with native cpp
Join Date: 15 Feb 23
Posts: 2
Posted: Mon, 2023-06-26 00:11
I want to use uint8 data using userbuffer to inference, how to do it, I got
"error_code=201; error_message=Casting of tensor failed. Expected user buffer input for images; error_component=Dl System"
error by create a buffer like this:
- uint8_t* src = (uint8_t*)input.data();
- zdl::DlSystem::UserBufferEncodingUnsigned8Bit userBufferEncodingUint8;
- snpeUserBackedBuffers.push_back(ubFactory.createUserBuffer(src,bufSize,strides,&userBufferEncodingUint8));
when I change this userbuffer to float, it's running normally