Solved by bask0 in post #2 
              
              
                It seems  _thread.lock.acquire  indicates that the main process is waiting for IO. Problem is solved by making the input pipeline more efficient and by setting pin_memory=False.