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

code error in dataset py #37

Open
dota2mhxy opened this issue Apr 14, 2022 · 4 comments
Open

code error in dataset py #37

dota2mhxy opened this issue Apr 14, 2022 · 4 comments

Comments

@dota2mhxy
Copy link

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

@dota2mhxy
Copy link
Author

@hytseng0509

@hytseng0509
Copy link
Owner

Do you follow the instruction here to prepare the dataset? data_file should point to the location of a .json file, it should not be a list.

@dota2mhxy
Copy link
Author

dota2mhxy commented Apr 15, 2022

yes,I downloaded five datasets and formed JSON files according to the steps,
sendpix3

I used params.dataset == 'multi' in my training, so I will use the four datasets except the testset,
sendpix2

the variable base_file is has four json file,is list ,
this cuase the error in this mehod
image

@hytseng0509

@hytseng0509
Copy link
Owner

The current code does not support training the baseline approach with multiple datasets.
If you want to you can consider manually modify the code similar to this.

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

2 participants