import torchfrom torchvision import transformsfrom torchvisiondatasets import ImageFolderfrom torchutilsdata import DataLoaderimport torchoptim as optimimport torchnnfunctional as Fimport matplotlibpy
The error message indicates that it couldn't find any class folder in the "./data/train" directory.
Please make sure that you have the correct directory structure for your dataset. The ImageFolder dataset expects the images to be organized in subdirectories, where each subdirectory corresponds to a different class. For example, if you have 10 classes, the "./data/train" directory should contain 10 subdirectories, each containing the images for that class.
You can check the directory structure of your dataset and make sure it matches the expected structure
原文地址: https://www.cveoy.top/t/topic/igxZ 著作权归作者所有。请勿转载和采集!