ML
M1ddle
这个作者很懒,什么都没留下…
展开
-
Tensorflow2: No gradients provided for any variable: 报错
在使用 TF2 的 GradientTape() 时报此类错误基本是因为 loss 和所给的变量没有联系,因此也就无法传递梯度。我的代码具体报错是因为(例子):# 先定义一个神经网络:modelwith tf.GradientTape() as tape: x = tf.constant([[1., 2., 3.]]) y = model(x).numpy() ... # 问题就出在上面这一步, # 因为我需要对'y'的取值做一些操作,所以用了.numpy()操作。 # 继续看下一步 lo原创 2020-05-27 17:43:26 · 3720 阅读 · 6 评论 -
tensorflow2.1安装后import报错:Internal Python error in the inspect module.
我报错的原因是Win10没有装“Visual Studio 2015、2017 和 2019 的 Microsoft Visual C++ 可再发行组件”,在官网下载指定版本安装即可。感谢这篇博文!原创 2020-04-13 16:33:19 · 1319 阅读 · 0 评论