-
Notifications
You must be signed in to change notification settings - Fork 423
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
Allow general pickle-able types as state objects? #190
Comments
Hi! thanks for your contribution!, great first issue! |
Hi @christopherbate , torchvision have also added a BTW I've also written a quick torchmetrics |
Hi @christopherbate, |
That's interesting, thanks. Regarding the |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
🚀 Feature + Motivation
Some types of metrics, such as "COCO detection metrics" for computer vision are more easily computed by operating on lists of dictionaries containing arrays rather than pure tensors. In this case, the developer would like to keep multiple pieces of information about each prediction, such as the example ID, bounding boxes and associated scores, etc. I recently wrote a
torchmetrics
wrapper for COCO API metrics, but it was made more complicated by requiring the state objects to be tensors. It would be trivial if I could keep a list of dictionaries as the state object. Synchronization in Torch >= 1.8.0 can be done easily viaall_gather_objects
but for < 1.8.0 requires some pickling into a Tensor hack.Pitch
Allow state objects to have lists of pickle-able objects.
Alternatives
Without this, I need to keep several state objects broken out by the sub-keys of my dictionary. It's not necessarily difficult but it is more code.
I can probably help do this unless someone can point out why it's too difficult/impossible. I still need to dig into the source a bit more.
The text was updated successfully, but these errors were encountered: