Skip to content

Unsupported type#


NeptuneUnsupportedType: You're attempting to log a type that is not directly supported by Neptune (<type_of_the_object>).


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.


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():

Does not work

>>> run["tuple"] = ("hi", 1)
>>> # tuple isn't supported


>>> run["tuple"] = str(("hi", 1))
>>> run["tuple"]
<String field at "tuple">

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

>>> run["complex_dict"] = {"tuple": ("hi", 1), "metric": 0.87}
>>> # Doesn't work because the tuple isn't a supported type


>>> from neptune.utils import stringify_unsupported
>>> run["complex_dict"] = stringify_unsupported({"tuple": ("hi", 1), "metric": 0.87})
>>> run["complex_dict/tuple"]
<String field at "complex_dict/tuple">

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.

Does not work

>>> run["metric"].append([0.51, 0.52])


>>> run["metric"].extend([0.51, 0.52])

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:

run["train"].append({"acc": acc, "loss": loss})

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:

values = [...]
for v in values:
    if not math.isinf(v) and not math.isnan(v):

Getting help