Skip to content

Commit f6f87aa

Browse files
committed
Fix RuntimeError: Caught RuntimeError in pin memory thread for device
0." ref #172
1 parent 0572a9e commit f6f87aa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

train.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,10 @@ def collate_fn(batch):
340340
s, e = 1, max_decoder_target_len + 1
341341
# if b_pad > 0:
342342
# s, e = s - 1, e - 1
343+
# NOTE: needs clone to supress RuntimeError in dataloarder...
344+
# ref: https://github.com/pytorch/pytorch/issues/10756
343345
frame_positions = torch.arange(s, e).long().unsqueeze(0).expand(
344-
len(batch), max_decoder_target_len)
346+
len(batch), max_decoder_target_len).clone()
345347

346348
# done flags
347349
done = np.array([_pad(np.zeros(len(x[1]) // r // downsample_step - 1),

0 commit comments

Comments
 (0)