Skip to content
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

non-str key in hparam dict causes exception in logging #5311

Closed
indigoviolet opened this issue Dec 30, 2020 · 2 comments · Fixed by #5354
Closed

non-str key in hparam dict causes exception in logging #5311

indigoviolet opened this issue Dec 30, 2020 · 2 comments · Fixed by #5354
Assignees
Labels
bug Something isn't working help wanted Open to be worked on priority: 1 Medium priority task
Milestone

Comments

@indigoviolet
Copy link

🐛 Bug

The _flatten_dict function in LightningLoggerBase assumes that dicts will only have string keys. Passing a hparam like {2:3} will break it.

Please reproduce using the BoringModel

https://colab.research.google.com/drive/1qN5oIzPcH18QSZhAMy9N-YDkeDkc4-fy

To Reproduce

Use following BoringModel and post here

Expected behavior

It should cast to str before logging

Environment

Note: Bugs with code are solved faster ! Colab Notebook should be made public !

You can get the script and run it with:

wget https://github.com/raw/PyTorchLightning/pytorch-lightning/master/tests/collect_env_details.py
# For security purposes, please check the contents of collect_env_details.py before running it.
* CUDA:
	- GPU:
		- Tesla T4
	- available:         True
	- version:           10.1
* Packages:
	- numpy:             1.18.5
	- pyTorch_debug:     False
	- pyTorch_version:   1.6.0+cu101
	- pytorch-lightning: 0.10.0
	- tqdm:              4.41.1
* System:
	- OS:                Linux
	- architecture:
		- 64bit
		- 
	- processor:         x86_64
	- python:            3.6.9
	- version:           #1 SMP Thu Jul 23 08:00:38 PDT 2020
### Additional context

<!-- Add any other context about the problem here. -->
@indigoviolet indigoviolet added bug Something isn't working help wanted Open to be worked on labels Dec 30, 2020
@Borda Borda added priority: 0 High priority task priority: 1 Medium priority task and removed priority: 0 High priority task labels Dec 31, 2020
@Borda
Copy link
Member

Borda commented Dec 31, 2020

@indigoviolet good catch, mind sending a PR with the fix? 🐰

@tchaton tchaton added bug Something isn't working and removed bug Something isn't working labels Jan 4, 2021
@tchaton tchaton added this to the 1.1.x milestone Jan 4, 2021
@marload
Copy link
Contributor

marload commented Jan 4, 2021

Can i take this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Open to be worked on priority: 1 Medium priority task
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants