ContinualAI / ContinualAI/avalanche

DataType error when computing dataset logits in DER Task-Incremental scenario

Open
#1,657 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
2.1k
Forks
321
PR merge metrics
No merged PRs in 30d

Description

When training a multi-head module with DER there seems to be a bug as the `compute_dataset_logits()` function is expected to return a tensor, but seemingly creates a dictionary.

To replicate, simply run the [multihead.py](https://github.com/ContinualAI/avalanche/blob/master/examples/multihead.py) with the DER strategy.

I tried fixing the problem by adding a check on the aforementioned function to see if a dictionary is being generated as the output of the model and to convert the dictionary values into the desired data type (lines 48 to 52 on [der.py](https://github.com/ContinualAI/avalanche/blob/master/avalanche/training/supervised/der.py)):
```
if(isinstance(out,dict)):
out = out.values()
out = list(out)[0]
```
but sometimes this conversion yields tensors with seemingly random sizes ([128,6] or [128,9] instead of the expected [128,10])

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.