Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The time consuming of preprocessing? #93

Open
LDoubleZhi opened this issue Sep 16, 2019 · 2 comments
Open

The time consuming of preprocessing? #93

LDoubleZhi opened this issue Sep 16, 2019 · 2 comments

Comments

@LDoubleZhi
Copy link

lb = vn_data.transform.Letterbox(hyper_params.network_size) it = tf.ToTensor() img_tf = vn_data.transform.Compose([lb, it]) s1 = time.time() data = img_tf(img).cuda() e1 = time.time() data = torch.unsqueeze(data, 0) print('preprocessing per img consume: {}'.format(e1 - s1))
I find it cost 0.02s on K80, and the code in speed.py have not include preprocessing(padding-rescale & .cuda()). how to solve it?

@LDoubleZhi
Copy link
Author

When I am using cv2, the time consuming reduce to 0.007s. But the output = net(data) cost 0.1s. I don't konw why.

@LDoubleZhi
Copy link
Author

In fact, When I am runing the code. sometime the net cost 0.01s, and sometime it cost 0.1s. It's ridiculous. I am using single k80

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant