Commit 833f053d authored by Myle Ott's avatar Myle Ott Committed by Facebook Github Bot
Browse files

Suppress leaked semaphore warnings

Summary: Pull Request resolved: https://github.com/fairinternal/fairseq-py/pull/844

Differential Revision: D16985131

Pulled By: myleott

fbshipit-source-id: 66ba3b9aa0cdf329a1e38fc09786f34906afdb43
parent 4fc39538
......@@ -5,6 +5,7 @@
import itertools
import math
import os
import numpy as np
import torch
......@@ -248,6 +249,9 @@ class EpochBatchIterator(EpochBatchIterating):
if offset > 0 and offset >= len(batches):
return None
if self.num_workers > 0:
os.environ['PYTHONWARNINGS'] = 'ignore:semaphore_tracker:UserWarning'
return CountingIterator(
torch.utils.data.DataLoader(
self.dataset,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment