训练gpt2时出现的问题,报错信息如下图所示:
详细信息为:
ValueError: Variable model/wpe already exists, disallowed. Did you mean to set reuse=True or reuse=tf.AUTO_REUSE in VarScope? Originally defined at:
解决方法:
每次训练前加上如下两行命令即可。
import tensorflow as tf
tf.reset_default_graph()
参考资料: