tensoflow模型中提示:reuseRuntimeError: Variable FirstStageBoxPredictor/BoxEncodingPredictor/weights already exists, disallowed. Did you mean to set reuse=True or reuse=tf. AUTO_REUSE in VarScope? 解决办法
背景
当训练完成后想使用训练完成的模型直接进行评估,故在训练脚本最后把调用评估脚本,然后报以上错误。解决方法:
方法一:根据提示信息将对应的代码改为: reuse=tf.AUTO_REUSE
方法二:在程序循环调用的位置之前,使用:tf.reset_default_graph()
通过报错信息并未找到方法一的代码,所以使用的是方法二。在调用评估代码之前使用