Add optional arguments to ImageDataManager#494
Open
ZXYFrank wants to merge 3 commits into
Open
Conversation
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!
Owner
|
I see. That makes sense. You also need to add |
add **kwargs to all occurrences of `init_image_dataset ` in `datamanager.py`
Author
|
Ok. there are 4 occurrences in You can see if it matches the logic. I haven't done serious check, and I'm not quite sure about the fix here. |
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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!