Skip to content

Conversation

@ZXYFrank
Copy link

Add **kwargs optional arguments to ImageDataManager

I defined a custom ImageDataset, which takes some additional arguments for init.

According to use custom dataset, the officially recommended way to use the dataset is to use the ImageDataManager

I tried to pass **kwargs(a dict) into the torchreid.data.ImageDataManager() constructor. Unfortunately, due to the positional(fixed) arguments of the function init_image_dataset (in datamanager.py), the constructor of my own custom dataset cannot receive any additional arguaments.

I hope it will fix the problem!

Add **kwargs optional arguments to ImageDataManager, which will ensure flexibility of the custom and registered dataset
Add **kwargs optional arguments to ImageDataManager

I defined a custom ImageDataset, which takes some additional arguments for init.

According to [use custom dataset](https://kaiyangzhou.github.io/deep-person-reid/user_guide.html#use-your-own-dataset), the officially recommended way to use the dataset is to use the ImageDataManager

I tried to pass **kwargs(a dict) into the torchreid.data.ImageDataManager() constructor. Unfortunately, due to the **positional(fixed)** arguments of the function `init_image_dataset` (in datamanager.py), the constructor of my own custom dataset cannot receive any additional arguaments.

I hope it will fix the problem!
@KaiyangZhou
Copy link
Owner

I see. That makes sense.

You also need to add **kwargs to all init_image_dataset functions

add **kwargs to all occurrences of `init_image_dataset ` in `datamanager.py`
@ZXYFrank
Copy link
Author

Ok. there are 4 occurrences in datamanager.py.

You can see if it matches the logic. I haven't done serious check, and I'm not quite sure about the fix here.

@KaiyangZhou
Copy link
Owner

I've checked the other parts that are associated with this argument. All look fine.

Can you do me a favor: run the code to train a tiny model on market (use the smallest image size like 64x64) to see if any bug occurs? To expedite the process, set the total epoch to 2 (need to see if both the train and test parts work)

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

Successfully merging this pull request may close these issues.

2 participants