Skip to content

Commit

Permalink
fix(preprocessing/video): add one environment variable for trying to …
Browse files Browse the repository at this point in the history
…limit decord memory usage
  • Loading branch information
ruancomelli committed Jun 15, 2022
1 parent f6841bc commit c3bae74
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions boiling_learning/preprocessing/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import contextlib
import gc
import os
import subprocess
import typing
from pathlib import Path
Expand Down Expand Up @@ -130,6 +131,9 @@ def __exit__(

class DecordVideo(Video):
def __init__(self, path: PathLike) -> None:
# workaround for limiting memory usage
os.environ['DECORD_EOF_RETRY_MAX'] = '128'

self.path = resolve(path)
self._video: Optional[decord.VideoReader] = None

Expand Down

0 comments on commit c3bae74

Please sign in to comment.