Skip to content
Discussion options

You must be logged in to vote

The ThreadDataLoader class is using Python threads which still need to have the GIL locked to execute. If all your transforms are pure Python then this will interfere with the main (training) thread, however typically transforms are using Numpy, Pytorch, or some other library using compiled code which releases the GIL. The purpose of this class is to take advantage of this and of the fact that training is mostly done in compiled code, despite the GIL it will in certain situations allow overlapping of training and batch queuing. If either training time or batch queue time a much longer than the other there will be less benefit however.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@hw-ju
Comment options

Answer selected by wyli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants