Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x 启用急切执行时,从keras模型手动访问和更新可训练变量_Python 3.x_Tensorflow_Keras_Eager Execution - Fatal编程技术网

Python 3.x 启用急切执行时,从keras模型手动访问和更新可训练变量

Python 3.x 启用急切执行时,从keras模型手动访问和更新可训练变量,python-3.x,tensorflow,keras,eager-execution,Python 3.x,Tensorflow,Keras,Eager Execution,当使用“渴望执行”和a时,如何访问和更新可训练变量?我在中看到一些代码似乎可以处理图形模式和急切执行,但我很难理解。我想更直接地了解如何手动更新可训练变量,以便使用自己的优化器 注意/仅供参考…当我尝试使用“=”符号为model.variables调用的输出分配新值时,我得到一个“TypeError:‘ResourceVariable’对象不支持项分配” 我在github上找到了答案,但它对我不起作用……抛出一个“AttributeError:'tensorflow.python.framewo

当使用“渴望执行”和a时,如何访问和更新可训练变量?我在中看到一些代码似乎可以处理图形模式和急切执行,但我很难理解。我想更直接地了解如何手动更新可训练变量,以便使用自己的优化器

注意/仅供参考…当我尝试使用“=”符号为model.variables调用的输出分配新值时,我得到一个“TypeError:‘ResourceVariable’对象不支持项分配”

我在github上找到了答案,但它对我不起作用……抛出一个“AttributeError:'tensorflow.python.framework.ops.热切Tensor'对象没有属性'assign'”