kenshohara / 3D-ResNets-PyTorch

3D ResNets for Action Recognition (CVPR 2018)
MIT License
3.87k stars 930 forks source link

run util_scripts.generate_video_jpgs get TypeError: __init__() got an unexpected keyword argument 'capture_output' #202

Open Rongtao-Xu opened 4 years ago

Rongtao-Xu commented 4 years ago

Traceback (most recent call last): File "/home/changwei/anaconda3/envs/3D/lib/python3.6/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/home/changwei/anaconda3/envs/3D/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/xurongtao/3D-ResNets-PyTorch/util_scripts/generate_video_jpgs.py", line 117, in for class_dir_path in class_dir_paths) File "/home/xurongtao/.local/lib/python3.6/site-packages/joblib/parallel.py", line 1042, in call self.retrieve() File "/home/xurongtao/.local/lib/python3.6/site-packages/joblib/parallel.py", line 921, in retrieve self._output.extend(job.get(timeout=self.timeout)) File "/home/changwei/anaconda3/envs/3D/lib/python3.6/multiprocessing/pool.py", line 644, in get raise self._value File "/home/changwei/anaconda3/envs/3D/lib/python3.6/multiprocessing/pool.py", line 119, in worker result = (True, func(*args, kwds)) File "/home/xurongtao/.local/lib/python3.6/site-packages/joblib/_parallel_backends.py", line 593, in call return self.func(*args, *kwargs) File "/home/xurongtao/.local/lib/python3.6/site-packages/joblib/parallel.py", line 253, in call for func, args, kwargs in self.items] File "/home/xurongtao/.local/lib/python3.6/site-packages/joblib/parallel.py", line 253, in for func, args, kwargs in self.items] File "/home/xurongtao/3D-ResNets-PyTorch/util_scripts/generate_video_jpgs.py", line 65, in class_process video_process(video_file_path, dst_class_path, ext, fps, size) File "/home/xurongtao/3D-ResNets-PyTorch/util_scripts/generate_video_jpgs.py", line 17, in video_process p = subprocess.run(ffprobe_cmd, capture_output=True) File "/home/changwei/anaconda3/envs/3D/lib/python3.6/subprocess.py", line 403, in run with Popen(popenargs, kwargs) as process: TypeError: init() got an unexpected keyword argument 'capture_output'

guilhermesurek commented 4 years ago

capture_output was introduced in Python 3.7 version https://stackoverflow.com/questions/53209127/subprocess-unexpected-keyword-argument-capture-output/53209196

@kenshohara should Python 3.7 be a requirement?

elaheyenaz65 commented 4 years ago

replace line 17 in generate_videos_jpgs.py with p = subprocess.run(ffprobe_cmd , stdout=PIPE, stderr=PIPE) and also dont forget to add (from subprocess import PIPE) at the begining of this file

Fishhao123 commented 4 years ago

@elaheyenaz65 It works, thanks!

xinmiaolin commented 3 years ago

@elaheyenaz65 thanks a lot!