TyperError: excepted str,byte or os.PathLike object, not io.TextIOWrapper

代码

    self.image_files = [line.split('\n')[0] for line in open(files_list[0])]

报错

TyperError: excepted str,byte or os.PathLike object, not io.TextIOWrapper_第1张图片

解决方案:添加代码.name

    self.image_files = [line.split('\n')[0] for line in open(files_list[0].name)]

你可能感兴趣的:(机器学习)