Tensorflow模型代码调试问题

背景:

       不知道大家有没有这样的烦恼:在使用Tensorflow搭建好模型调试的过程中,经常会碰到一些问题,当时花了不少时间把这个问题解决了,一段时间后,又出现了同样的问题,却怎么也不记得之前是怎么解决的,结果又得再来一遍。

        为了不让这样的情况再次发生,特在此记录下来,以备后查。

正文:

问题列表如下:

        问题1:

                Did you mean to set reuse=True or reuse =tf.AUTO_REUSE in Varscope?

                解决方法:

                增加一行:tf.get_variable_scope_scope().reuse_variables() in compute_loss / accuracy

         问题2:

                Fetch argument32. has invalid <type> cannot convert a float32 into a Tensor or Operation

                解决方法:

                run语句前后的变量不能相同。

                

猜你喜欢

转载自www.cnblogs.com/jimchen1218/p/11839868.html
今日推荐