Intel® Distribution of OpenVINO™ Toolkit
Community support and discussions about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all things computer vision-related on Intel® platforms.
6017 Discussions

Inference engine input image astype to FP16 get ValueError: could not convert string to float

TseHsien
Beginner
300 Views

I try this tutorial to create my own inference engine.

When I try to create random input data to the inference_request, it can work normally.

random_input_data = np.random.randn(1, 3, 224, 224).astype(np.float16)
tensor_description = TensorDesc(precision="FP16", dims=(1, 3, 224, 224), layout='NCHW')
input_blobs = Blob(tensor_description, random_input_data)

But if I replace random_input_data with my real image path

random_input_data = np.array(r"C:\MyImagePath\XXX.png").astype(np.float16)

I get the error message

ValueError: could not convert string to float: 'C:\\MyImagePath\\XXX.png'

Why I cannot astype my real image to FP16?

(I use Windows 10 with openvino_2021.4.689)

0 Kudos
1 Solution
Iffa_Intel
Moderator
239 Views

Hi,

 

This case is similar to this StackOverflow thread.

Please help to refer to that thread since we had provided an answer there.

 

 

Sincerely,

Iffa

 

View solution in original post

1 Reply
Iffa_Intel
Moderator
240 Views

Hi,

 

This case is similar to this StackOverflow thread.

Please help to refer to that thread since we had provided an answer there.

 

 

Sincerely,

Iffa

 

Reply