Skip to content

Error with metrics with None averaging #9528

@BardiaKh

Description

@BardiaKh

🐛 Bug

There is an issue when using torch metrics with an averaging method of None. It seems that when the trainer is checking if the metrics are ready, as they are tensors of multiple elements (one for each class) they cannot be interpreted as booleans, hence the process crashes.

To Reproduce

https://colab.research.google.com/drive/1Hil03eDMHynRDNa0dG9SAVuPqmc0w2vo?usp=sharing

Expected behavior

Just continue to the second epoch.

Environment

* CUDA:
	- GPU:
		- Tesla K80
	- available:         True
	- version:           10.2
* Packages:
	- numpy:             1.19.5
	- pyTorch_debug:     False
	- pyTorch_version:   1.9.0+cu102
	- pytorch-lightning: 1.4.6
	- tqdm:              4.62.0
* System:
	- OS:                Linux
	- architecture:
		- 64bit
		- 
	- processor:         x86_64
	- python:            3.7.11
	- version:           #1 SMP Sat Jun 5 09:50:34 PDT 2021

Additional context

None.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingloggingRelated to the `LoggerConnector` and `log()`

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions