Skip to content

code error in dataset py #37

@dota2mhxy

Description

@dota2mhxy

Hello, when I run the code train_ baseline.py, I use multiple domains during training, but the code reports an error。

File "/home/wangchengcheng/WCC/CrossDomainFewShot/train_baseline.py", line 96, in
base_loader = base_datamgr.get_data_loader( base_file , aug=params.train_aug )
File "/home/wangchengcheng/WCC/CrossDomainFewShot/data/datamgr.py", line 57, in get_data_loader
dataset = SimpleDataset(data_file, transform)
File "/home/wangchengcheng/WCC/CrossDomainFewShot/data/dataset.py", line 15, in init
with open(data_file, 'r') as f:
TypeError: expected str, bytes or os.PathLike object, not list

The error code is in dataset py

class SimpleDataset:
def init(self, data_file, transform, target_transform=identity):
with open(data_file, 'r') as f:
self.meta = json.load(f)
self.transform = transform
self.target_transform = target_transform

I saw data_file is list , so I reported an error. Maybe you have corrected this problem, but there is a problem with the code version. Thank you for your reply

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions