求助20241130视频生成模型部署过程中部署示例(TokenFlow)运行示例报错 #409
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: HswOAuth/llm_course#409
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
按文档配置了环境,下载了预训练模型,修改了文件模型对应得地址

之后运行示例时报错,调整了运行命令里面的data/woman-running.mp4还是报错,请教一下是什么原因?
我也有类似的问题;我遇到的是1文件不存在 (av.error.FileNotFoundError): 程序找不到指定的文件 woman-running.mp4。确保视频文件在正确的位置,并且路径名拼写正确。
2AVError 模块属性错误 (AttributeError: module 'av' has no attribute 'AVError'): 这个错误通常表明av库版本可能不支持该属性。可以尝试升级或重新安装 av 库。 AI问答无果,av库是已经存在的,并且版本是最新的,不知道是不是可能与什么不兼容
write_video(os.path.join(save_path, f'inverted.mp4'), frames, fps=10)
width, height = frames[0].shape[1] ,frames[0].shape[2]
fourcc = cv2.VideoWriter_fourcc(*'mp4v') # 定义编解码器
video = cv2.VideoWriter(os.path.join(save_path, f'inverted.mp4'), fourcc, 10, (width, height))
for frame in frames:
frame = frame.numpy()
video.write(frame)
video.release()
报错的原因是torchvision在写入视频的时候有bug,把preprocess.py的332行左右的write_video的内容注释,然后在下面添加如上代码即可
write_video(os.path.join(save_path, f'inverted.mp4'), frames, fps=10)
width, height = frames[0].shape[1] ,frames[0].shape[2]
fourcc = cv2.VideoWriter_fourcc(*'mp4v') # 定义编解码器
video = cv2.VideoWriter(os.path.join(save_path, f'inverted.mp4'), fourcc, 10, (width, height))
for frame in frames:
frame = frame.numpy()
video.write(frame)
video.release()