robustness icon indicating copy to clipboard operation
robustness copied to clipboard

TypeError: endswith first arg must be str or a tuple of str, not list

Open double-fire-0 opened this issue 4 years ago • 0 comments

File"/mnt/lustre/share/spring/conda_envs/miniconda3/envs/s0.3.3/lib/python3.6/sitepackages/torchvision/datasets/folder.py", line 19, in has_file_allowed_extension return filename.lower().endswith(extensions) TypeError: endswith first arg must be str or a tuple of str, not list

I find this error and solve this error by doing this: Change line 18 from video_loader.py from super(VideoFolder, self).__init__(root, loader, ['.mp4'], transform=transform, target_transform=target_transform) to super(VideoFolder, self).__init__(root, loader, '.mp4', transform=transform, target_transform=target_transform)

Then the error will not occur and it works well. I think it may be a problem about the version of torchvision. What is your version of torchvision? For me it is '0.6.0+cu90'

double-fire-0 avatar Jul 08 '21 09:07 double-fire-0