Ask Your Question
1

Does OpenCV::DNN support 16 bit float arithmetic?

asked 2018-04-05 11:35:54 -0600

Rbt gravatar image

Recently I used the dnn::shrinkCaffeModel to convert a Caffe network to half precision floating point. When I used the new network, I saw that forward pass time was about the same time (in fact a little slower) as in the original network.

I expected the new model to be faster!!!!!, but it was not like that. Please, any explanation?

I guess DNN does not support 16 bit float point arithmetic (only convert from 16bit to 32bit and viceversa) or it's my laptop that does not support it, but I'm not sure.

edit retag flag offensive close merge delete

Comments

1

@Rbt, Yeah, OpenCV can import models with fp16 weights (Caffe/TensorFlow) or uint8 (TensorFlow) into fp32 format. All the computations are in single precision floats (fp32). There is a PR with FP16 support for Intel's GPUs: https://github.com/opencv/opencv/pull.... Read more in OpenCV's evolution proposal: https://github.com/opencv/opencv/issu....

dkurt gravatar imagedkurt ( 2018-04-05 11:55:11 -0600 )edit
1

Whoops, I accidently deleted @Rbt 's response "Thanks, this answered my question", so I'm reposting it here.

@dkurt , how about reposting your comment as an answer?

opalmirror gravatar imageopalmirror ( 2018-04-06 14:46:28 -0600 )edit

@opalmirror, sure. Done!

dkurt gravatar imagedkurt ( 2018-04-06 14:48:48 -0600 )edit

Thanks! @Rbt, if you can mark that the answer is correct, I think we're all set. :)

opalmirror gravatar imageopalmirror ( 2018-04-06 14:50:36 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2018-04-06 14:48:27 -0600

dkurt gravatar image

@Rbt, Yeah, OpenCV can import models with fp16 weights (Caffe/TensorFlow) or uint8 (TensorFlow) into fp32 format. All the computations are in single precision floats (fp32). There is a PR with FP16 support for Intel's GPUs: https://github.com/opencv/opencv/pull.... Read more in OpenCV's evolution proposal: https://github.com/opencv/opencv/issu....

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-04-05 11:35:54 -0600

Seen: 2,261 times

Last updated: Apr 06 '18