When you happened to use absl
in google colab, you could easily bump into Duplicate Flag Error
especially when you run flags.DEFINE_
twice (or when you want to add new define).
from absl import flagsFLAGS = flags.FLAGS
Add the following code to reset the define.
for name in list(flags.FLAGS): delattr(flags.FLAGS,name)
The do your define, or add additional define
flags.DEFINE_string('name', None, 'Project name')flags.DEFINE_integer('version', 1, 'Version number')