[英]How to debug in Tensorflow2?
I am new to Tensorflow and am currently working on Tensorflow2.我是 Tensorflow 的新手,目前正在研究 Tensorflow2。 I'm still having a hard time writing code, because I don't have the possibility to debug.
我仍然很难编写代码,因为我没有调试的可能性。
I already tried to get further with the line:我已经尝试过进一步使用这条线:
tf.executing_eagerly()
and
tf.print()
but this is only a small help compared to the "normal" debugging in python.但这与 python 中的“正常”调试相比只是一个小小的帮助。
Is there a better possibility to debug the code and to view the content of variables?是否有更好的调试代码和查看变量内容的可能性?
The only thing I currently get is this view, but that doesn't give me any insight into the actual variables either:我目前唯一得到的是这个视图,但这也没有让我对实际变量有任何了解:
Rather than using tf.print
, use the normal Python's print
if you are eagerly executing.如果您急切地执行,请使用普通 Python 的
print
而不是使用tf.print
。 You will be able to see the contents of the variables.您将能够看到变量的内容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.