Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warnings.warn('No file found at "{}"'.format(fpath)) #52

Open
weiyikang opened this issue Dec 8, 2022 · 3 comments
Open

warnings.warn('No file found at "{}"'.format(fpath)) #52

weiyikang opened this issue Dec 8, 2022 · 3 comments

Comments

@weiyikang
Copy link

weiyikang commented Dec 8, 2022

Following the steps in README, there still are some errors to run the demo.
The path of dataset maybe have errors, but I have checked carefully, and the "file not found" errors still exist.
image
You can see the files can be found in "/home/wyk/dataset/office31/amazon/images/ruler"
image
How to run a demo on dassl.pytorch? Looking forward to your reply!

@Waybaba
Copy link

Waybaba commented Dec 23, 2022

same error

@dw1360585641
Copy link

i met the issue too,and dont know how to deal it

@dw1360585641
Copy link

dw1360585641 commented Sep 26, 2024

我也遇到了这个问题,不知道如何处理

def _read_data(self, input_domains):
    items = []

    for domain, dname in enumerate(input_domains):
        domain_dir = os.path.join(self.dataset_dir, dname)
        print("domain_dir:", domain_dir)
        class_names = listdir_nohidden(domain_dir)
        class_names.sort()

        for label, class_name in enumerate(class_names):
            class_path = os.path.join(domain_dir, class_name)
            print("class_path:", class_path)
            imnames = listdir_nohidden(class_path)
            print("imnames:", imnames)

            for imname in imnames:
                # 检查 imname 是否是目录
                impath_dir = os.path.join(class_path, imname)
                if os.path.isdir(impath_dir):
                    # 读取子目录下的图像文件
                    sub_imnames = listdir_nohidden(impath_dir)
                    for sub_imname in sub_imnames:
                        impath = os.path.join(impath_dir, sub_imname)
                        print("impath:", impath)
                        if os.path.isfile(impath):
                            item = Datum(
                                impath=impath,
                                label=label,
                                domain=domain,
                                classname=class_name
                            )
                            print("item:",item)
                            items.append(item)
                        else:
                            print("No such file or directory:", impath)
                else:
                    print("Not a directory:", impath_dir)

    return items

i remake mydatasets.py, maybe is useful?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants