In this tutorial, we write an example to fix NaN bug when using tf.svd() function to compute singular value decomposition in tensorflow. We use np.linalg.svd() function to replace tensorflow original tf.svd() when computing. I tested this method in our train model. It works well.