"[...] contains NaN values. They have been converted to 1"

Working on my first project where I’m just moving around still images with transparent backgrounds in front of a Constant white background. After adding a new image, resizing it to 0.25 scale, moving it, and then merging it with the rest of the project, I was given two warnings.

Transform2 warning: Transform2: rendered rectangle (90,44)-(130,94) contains NaN values. They have been converted to 1.

and

Merge3 warning: Merge3: rendered rectangle (0,0)-(480,270) contains NaN values. They have been converted to 1

A response to this post suggests that

Most of the times getting NaNs mean that either something is wrong in your graph, or there is a bug somewhere in Natron or it’s plugins. If the graph is small enough, you can attach a project file and we can take a look at it.
Typical instructions that create NaNs are dividing zero by zero, and taking the square root of a negative number

The graph is still relatively small, would somebody be willing to take a look and see if there’s “something wrong” with it, or whether this is a bug? It seems like what I did was pretty simple, so I’m not sure where there was much room for me to mess something up… but then again, I shouldn’t doubt my ability to do something dumb in 3 steps or less =P

The project file is here:
https://drive.google.com/file/d/1-i-QxdLqj8ZY30kjnn6gXsSVD4U9vg9b/view?usp=sharing

And if it is a bug, is it the sort of thing I should open an issue on GitHub about?

Thanks for any help!

Just downloaded your file, but since the responding .png files are missing I can not exactly reproduce your issue.

However, in my comps I also often get the NaN error when pictures are in another resolution than the comp, but the resulting renders are still ok and I just kind of ignore the error message…

Thanks for your reply. It seems like it’s only when I’ve recently changed things that I get the errors. Once I’ve finished setting up my keys, then close and reopen the program, I can play through the whole project without an error.

This does make it seem like I can ignore the messages, so that brings up the question, is it possible to dismiss the errors? Right now, they just pile up and end up taking up a third of my viewer, and the big “WARNING” over top of the nodes makes then hard to read, which is frustrating.

Thanks again

EDIT: Actually still getting some errors, and I can’t find a rhyme or reason to them. That’s fine if I can ignore them, though, I guess. I’m still very interested in finding out if I can dismiss them because they really do get in the way.

You should try the latest RC (RC16 as of today, which includes AudioCurve), and if the problem persists, make a zip file with a project which can be used to reproduce the issue.

You can ignore NaNs. They’re usually the result of division by zero somewhere or taking the square root of a negative number, or any other illegal operation. Natron replaces these with 1s, so that processing can continue. Can you see where they are in the output image?

1 Like

I’m curious how to get rid of these messages too! I have several of them built up so it really takes away from the viewer window.

Sometimes routines use numerical objects which are not representative of numbers, but instead use the structure to transmit a payload.
Also, memory misalignments can put NaNs into number types. The behavior of a NaN is undefined, so blanking them out is the system’s way of preventing the unintended execution of a NaN payload. Other mathematical things also come in NaN shape, for instance infinitudes and infinitessimals.

The behaviour of NaN is defined, though not its value.

1 Like