Skip to content

keye_vl1.5训练时报错TypeError: stat: path should be string, bytes, os.PathLike or integer, not list #5901

@lumingze1111

Description

@lumingze1111

Describe the bug
What the bug is, and how to reproduce, better with screenshots(描述bug以及复现过程,最好有截图)
多帧视频帧作为训练数据训练keye时,输入出现这个报错
[rank2]: File "/nfs_data/jiaxin.ai/aijiaxin/work_18/ms-swift/swift/llm/template/template/kwai.py", line 42, in replace_tag
[rank2]: if os.path.isdir(video):
[rank2]: ^^^^^^^^^^^^^^^^^^^^
[rank2]: File "", line 42, in isdir
[rank2]: TypeError: stat: path should be string, bytes, os.PathLike or integer, not list
Your hardware and system info
Write your system info like CUDA version/system/GPU/torch version here(在这里给出硬件信息和系统信息,如CUDA版本,系统,GPU型号和torch版本等)

Additional context
Add any other context about the problem here(在这里补充其他信息)
是否可以将代码改为这种格式:
if isinstance(video, list):
pass
elif os.path.isdir(video):
video = [os.path.join(video, fname) for fname in os.listdir(video)]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions