question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feedback/Error] JSON serialisation issue when trying to log a metric of variable type set

See original GitHub issue
  • Weights and Biases version: 0.8.32
  • Python version: 3.7.2
  • Operating System: Linux/MacOS

Description

I was logging a variable/value that is of type set this caused JSON serialisation issues, similar to the error reported here https://stackoverflow.com/questions/8230315/how-to-json-serialize-sets (JSON serialisation failing when handling data with set data types).

Although the way python reported the error (low-level call stack information), it wasn’t clear if it was caused by wandb coming from my code. I looked to look at it closer, googled and then looked at my last commit change lead me to the solution.

What I Did

a = {'a', 'b', 'c'}
wandb.log({'metric': a})

Removing the line of code that logged the metric, resolved the issue. I then converted variable to a list and that worked fine.

I would suggest if we try to log an unsupported data-type, that warnings be reported during logging not when synchronising with remote. Also maybe some sort of error handling be introduced around conversions, so if they fail the user gets a call stack.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
neomatrix369commented, Dec 3, 2020

Hey @neomatrix369 In the past year we’ve majorly reworked the CLI and UI for Weights & Biases. We’re closing issues older than 6 months. Please comment to reopen.

Thanks for letting me know, I trust the raised issue is fixed in the newer version, I haven’t played with it yet look forward to it.

1reaction
ariG23498commented, Dec 3, 2020

Hey @neomatrix369 In the past year we’ve majorly reworked the CLI and UI for Weights & Biases. We’re closing issues older than 6 months. Please comment to reopen.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Feedback/Error] JSON serialisation issue when trying to log a ...
Description. I was logging a variable/value that is of type set this caused JSON serialisation issues, similar to the error reported here https ......
Read more >
JSON.NET Error Self referencing loop detected for type
The best solution is taken from Loop Reference handling in Web API (which most of this answer is copied from):. Fix 1: Ignoring...
Read more >
Serializing complex nested JSON - Amazon Redshift
When set, complex JSON data types are serialized to VARCHAR(65535). The nested JSON can be accessed with JSON functions. For more information, see ......
Read more >
JSON and serialization - Flutter documentation
Serializing JSON inline; Serializing JSON inside model classes. Serializing JSON using code generation libraries. Setting up json_serializable in a project ...
Read more >
Python JSON Serialize Set - PYnative
To solve TypeError: Object of type set is not JSON serializable we need to build a custom encoder to make set JSON serializable....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found