I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable TF_ENABLE_ONEDNN_OPTS=0.
WARNING:tensorflow:From C:\Users\Syang.conda\envs\pytorch\Lib\site-packages\keras\src\losses.py:2976: The name tf.losses.sparse_softmax_cross_entropy is deprecated. Please use tf.compat.v1.losses.sparse_softmax_cross_entropy instead.
pytorch里面怎么会一直弹TensorFlow的警告,而且查询了一下说的是
这个警告是由 TensorFlow 的一个版本更新引起的。在旧版本中,tf.losses.sparse_softmax_cross_entropy 是用于计算稀疏分类问题(标签为整数)的损失函数。然而,在新版本的 TensorFlow 中,这个函数已被标记为过时(deprecated),并建议使用 tf.compat.v1.losses.sparse_softmax_cross_entropy 替代。
tf.compat.v1 是 TensorFlow 提供的一个兼容性模块,用于向后兼容旧版本的代码。使用 tf.compat.v1.losses.sparse_softmax_cross_entropy 可以确保你的代码在新版本的 TensorFlow 中仍然能够正常运行。
在你提供的代码中,可能是因为 TensorFlow 的某个依赖库或其他相关代码使用了过时的函数 tf.losses.sparse_softmax_cross_entropy,从而触发了这个警告。
要解决这个警告,你可以将代码中的 tf.losses.sparse_softmax_cross_entropy 替换为 tf.compat.v1.losses.sparse_softmax_cross_entropy。这样可以确保你的代码在新版本的 TensorFlow 中继续正常运行,并避免警告信息的出现。
但是我并没有找到tf.losses.sparse_softmax_cross_entropy这一段代码
每训练一个epoch就会疯狂弹这个警告,严重影响训练速度

训练速度其实挺快的,但是会弹七八个警告之后才进入下一轮的训练
