我对python有一点经验,我目前正尝试通过这个guide通过pix2pix生成一些机器学习视频
我目前正处于需要从视频中提取帧的位置。我使用的是同一个视频,但为了方便起见,我将它移到了与extract_frames.py相同的目录中
我一直收到WinError 2:系统找不到指定的文件:
C:\Users\cadou\OneDrive\Desktop\ml\pix2pixHD>python extract_frames.py -video fire.mp4 -name fire_dataset -p2pdir . -width 1280 -height 736
creating the dataset structure
ffmpeg -v 16 -i C:\Users\cadou\OneDrive\Desktop\ml\pix2pixHD\fire.mp4 -q:v 2 -vf "scale=iw*736/ih:736, crop=1280:736" C:\Users\cadou\OneDrive\Desktop\ml\pix2pixHD/datasets/fire_dataset/train_frames/frame-%06d.jpg -hide_banner
extracting the frames
Traceback (most recent call last):
File "C:\Users\cadou\OneDrive\Desktop\ml\pix2pixHD\extract_frames.py", line 32, in <module>
video_utils.extract_frames_from_video(
File "C:\Users\cadou\OneDrive\Desktop\ml\pix2pixHD\video_utils.py", line 82, in extract_frames_from_video
p = subprocess.Popen(shlex.split(command), shell=False)
File "C:\Users\cadou\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 951, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\cadou\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
我查找了这个错误并尝试了一些方法,但似乎没有一种方法能解决我的问题。我怀疑这与路径有关,但我也尝试过改变这一点。我还安装了教程中要求的所有库(dominate、ffmpeg和pyTorch)
您可以尝试以下命令,将“fire.mp4”替换为“/fire.mp4”
Erorr不显示找不到的文件
也许它找不到
fire.mp4
,但我想它需要ffmpeg
来提取视频我在
video_utils.py
中检查了subprocess
的源代码,它运行ffmpeg,所以您需要从https://ffmpeg.org/安装它它可能还需要更改
video_utils.py
并使用C:\full\path\to\ffmpeg.exe
还有
Ubuntu
字体的硬编码路径(在两个地方:请参见code),这表明此代码是为Linux Ubuntu
创建的。此路径还需要更改Windows上的其他字体相关问题 更多 >
编程相关推荐