Shreeyak / pytorch-lightning-segmentation-template

Semantic Segmentation on the LaPa dataset using Pytorch Lightning
Apache License 2.0
13 stars 5 forks source link

bugfix: Trainer - pass gpu indices, config parse error when passing lists. #13

Closed Shreeyak closed 3 years ago

Shreeyak commented 3 years ago

The trainer.gpus, if given an int, indicates the number of gpus to use, instead of the ID of gpu to use. Corrected this by casting to str or list of ints in pydantic.

When passing lists to Hydra, the config contains the list as an OmegaConf config objects. It looks similar to python dicts and list, but it really different. This causes errors with Pydantic when trying to resolve lists. Hence, we convert to primitive containers before passing to pydantic for validation.