求助20241130视频生成模型部署过程中部署示例(TokenFlow)运行示例报错 #409

Open
opened 2024-12-03 10:39:59 +08:00 by slxx · 4 comments

按文档配置了环境,下载了预训练模型,修改了文件模型对应得地址
image

image
之后运行示例时报错,调整了运行命令里面的data/woman-running.mp4还是报错,请教一下是什么原因?
image

按文档配置了环境,下载了预训练模型,修改了文件模型对应得地址 ![image](/attachments/61f04da0-f98a-4cdf-abf9-5ef77a7d57b5) ![image](/attachments/e54d9950-69f5-4c3b-bdd4-47e95af71221) 之后运行示例时报错,调整了运行命令里面的data/woman-running.mp4还是报错,请教一下是什么原因? ![image](/attachments/66e4df3b-ec45-4877-9798-01a631eb2e0e)

我也有类似的问题;我遇到的是1文件不存在 (av.error.FileNotFoundError): 程序找不到指定的文件 woman-running.mp4。确保视频文件在正确的位置,并且路径名拼写正确。

2AVError 模块属性错误 (AttributeError: module 'av' has no attribute 'AVError'): 这个错误通常表明av库版本可能不支持该属性。可以尝试升级或重新安装 av 库。 AI问答无果,av库是已经存在的,并且版本是最新的,不知道是不是可能与什么不兼容

我也有类似的问题;我遇到的是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()

# 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的内容注释,然后在下面添加如上代码即可

报错的原因是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()

# 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()
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: HswOAuth/llm_course#409
No description provided.