AICamera-Style-Transfer icon indicating copy to clipboard operation
AICamera-Style-Transfer copied to clipboard

Issue using custom network (Converting tensor to float)

Open RavenPillmann opened this issue 5 years ago • 0 comments

Sorry, this may be a basic question, but:

I trained a network that takes a standardized float tensor as input. When I try to run the network, I get

E/StyleTransfer: Error performing StyleTransfer: [enforce fail at tensor.h:507] IsType<T>(). Tensor type mismatch, caller expects elements to be float while tensor contains unsigned char Error from operator: 
    input: "0" output: "49" name: "" type: "PadImage" arg { name: "pads" ints: 3 ints: 3 ints: 3 ints: 3 } arg { name: "mode" s: "reflect" } device_option { device_type: 0 cuda_gpu_id: 0 }
    ** while accessing input: 0

As far as I can tell, this means that the tensor I'm passing into the network via Predictors::run is an unsigned char rather than float tensor. I was hoping to convert my tensor into a float tensor and standardize it in preprocessImage in native-lib.cpp, but I can't for the life of me figure out how to convert the input tensor into a float tensor. Anyone have any suggestions?

RavenPillmann avatar Aug 20 '19 16:08 RavenPillmann