3D-ResNets-PyTorch icon indicating copy to clipboard operation
3D-ResNets-PyTorch copied to clipboard

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

Open Rongtao-Xu opened this issue 4 years ago • 4 comments

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'

Rongtao-Xu avatar May 27 '20 08:05 Rongtao-Xu

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?

guilhermesurek avatar Jun 05 '20 03:06 guilhermesurek

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

elaheyenaz65 avatar Jun 09 '20 09:06 elaheyenaz65

@elaheyenaz65 It works, thanks!

Fishhao123 avatar Aug 11 '20 12:08 Fishhao123

@elaheyenaz65 thanks a lot!

xinmiaolin avatar Nov 22 '20 15:11 xinmiaolin