Comments (7)
@xmyqsh This a very comprehensive analysis. Thanks very much!
To @adityaarun1 @weigq @xmyqsh , here is a quick fix (at least allows you to train at the same speed with fewer workers)
As suggested by @xingyizhou, I missed an accelerating part as implemented in the original hourglass: https://github.com/anewell/pose-hg-train/blob/master/src/util/img.lua#L91-L105
(Because I follow the python code here: https://github.com/anewell/pose-hg-train/blob/master/src/pypose/img.py#L48-L78)
This has been fixed in my latest commit: 88a2294
The original code is a bit difficult to understand for me. I try to implement this part in my own understanding. The result seems correct ( 140 epoch for hg-stack2-block1 achieves 86.3 PCKh).
from pytorch-pose.
@bearpaw the fix works. 👍
This thread on twitter might be of interest to us to further improve the efficiency of the data loader. People from FastAI have developed multi-processing + thread pool dataloader for PyTorch which works fine. But this adds an additional dependency to this repo.
from pytorch-pose.
@bearpaw
I used the torch version, it has the same problem. Though set the augmentation part ahead of crop operation in this pytorch version seems more appropriate but also more time-consuming. I have tried to remove the augmentation part, it has a bit of speedup.
Also, the np.linalg.inv operation is called 17 times. And the image reading is definitely time-consuming. So, the two main parts, image reading and image preprocessing are both time-consuming. And they wait for each other sometimes as we have seen.
It should be better to sperate the two parts with two Producer-Consumer model instead of just one.
For implementation, I think set a new dataloader on load_image
mpii.py#L90 and load_annot mpii.py#L70-#L73 in training phase should be OK.
For evaluation phase in the above Framework, an extra image_id to prediction map should also be added.
Personal opinion, hope helpful.
from pytorch-pose.
here about 15min a epoch with 1080ti and E5,
i think your issue may not be caused by the dataloader.
BTW, have you used cuda, cudnn?
from pytorch-pose.
@weigq Yes, I am using CUDA 8.0 and CUDNN 6. I don't think CUDA/CUDNN is an issue, as all my other codes are running just fine.
I have just tested it out another machine with same configuration and this slowness is still there. The slowness occurs only during the data loading part and not during the forward pass (which happens in few milliseconds).
from pytorch-pose.
This is a known issue, and I'm trying to fix it.
Basically, when all the loaded data are forwarded while the new data are not ready, the program needs to wait for the dataloader.
I think the augmentation part should be optimized (e.g. pose/datasets/mpii.py
). I also try to figure out which part is the most time-consuming. If you guys have some suggestions, don't hesitate to create a pull request or leave your comments here.
from pytorch-pose.
@bearpaw
In other words, zoom out of img = scipy.misc.imresize(img, [new_ht, new_wd])
which is a subsample operation is much faster than copy operation new_img[new_y[0]:new_y[1], new_x[0]:new_x[1]] = img[old_y[0]:old_y[1], old_x[0]:old_x[1]]
in terms of the same size.
So, the big copy operation on the original image is a bottleneck. Right?
from pytorch-pose.
Related Issues (20)
- Question about detections_our_format.mat HOT 1
- 关于MPII训练精度问题 HOT 3
- Some problems about the running process HOT 2
- Looking hg-s2-b1
- Is there any code about Multi-scale test in this implement?
- great idea to put together these models for pose estimation HOT 1
- When I try to train with lsp,I faced some problem HOT 2
- Whats the difference between the hourglass_gn & hourglass models? HOT 1
- How to train with your own data set
- coco_annotations_2014.json HOT 1
- Bug in crop method HOT 11
- “scale” message HOT 2
- Hello, I encountered the following problems when I was training the code. What is the reason? Python: 2.7, Pytorch: 0.4.1 HOT 1
- I cannot train! HOT 1
- How do you implement a model based on a certain epoch that you have already trained and then continue to train
- There are some training issues here
- `RuntimeError` in `HourglassNet` because of possibly incorrect `scale_factor` for `F.interpolate` HOT 2
- I had train using mscoco and lsp dataset,but I don't know how to eval the pck and mAP?could you give me some suggestions?Thanks HOT 1
- Does the appended output from the show_sample method look as intended?
- Question about calculating PCK in Python
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytorch-pose.