TrickyGo / Dive-into-DL-TensorFlow2.0

本项目将《动手学深度学习》(Dive into Deep Learning)原书中的MXNet实现改为TensorFlow 2.0实现,项目已得到李沐老师的认可
https://trickygo.github.io/Dive-into-DL-TensorFlow2.0/#/
Apache License 2.0
3.78k stars 820 forks source link

module 'tensorflow' has no attribute 'gradient' #25

Closed xiexuliunian closed 4 years ago

xiexuliunian commented 4 years ago

线性回归的从零开始实现一节

param.assign_sub(lr * tf.gradient(l, param) / batch_size)

代码报module 'tensorflow' has no attribute 'gradient'错误,改tf.gradient为t.gradient正常

archersama commented 4 years ago

已修复