Unsupported type#
Error
NeptuneUnsupportedType: You're attempting to log a type that is not directly supported by Neptune (<type_of_the_object>).
Issue#
You're attempting to log a value or object of a type that is not yet directly supported by Neptune.
In 0.x
versions of Neptune, unsupported types are implicitly cast to string
without raising any warnings or exceptions. To avoid situations where your metadata is not logged as you expect, as of version 1.0
, you need to explicitly log your value as a supported type. Otherwise, the unsupported value is skipped and Neptune prints a warning.
Workarounds#
In order to log your value or object to Neptune, you need to convert it to a supported type – such as a string or float.
Converting to string#
To convert your value or object, use some string representation method, such as str()
:
Using stringify_unsupported()
#
For more complex structures, you can use the utility function stringify_unsupported()
to convert values of unsupported types to strings.
Does not work
Works
Appending multiple values to series field#
You can use append()
to log a single value to a series field at a time.
To append multiple values to the same series at once, use extend()
instead.
Logging to multiple series at once#
To append single values to multiple series at once, you can pass a dictionary where each key represents a field name:
The above values will be logged to two separate series fields: acc
and loss
.
Working around None
, Inf
or NaN
#
Sometimes your metric may not be calculated correctly, which might result in the value None
. In this case, it's best to convert this value to, for example, 0
so that it can be logged to Neptune.
You can also add a check to filter out problematic values from your series: