Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Reset tensorflow tf.app.flags, in ipython notebook
# use the following snippet in your ipython notebook shell
import argparse
import tensorflow as tf
tf.app.flags.FLAGS = tf.python.platform.flags._FlagValues()
tf.app.flags._global_parser = argparse.ArgumentParser()
@ialhashim

This comment has been minimized.

Copy link

ialhashim commented Jan 11, 2018

This worked for me

import argparse as _argparse

tf.app.flags._global_parser = _argparse.ArgumentParser()
@jbachh

This comment has been minimized.

Copy link

jbachh commented Mar 12, 2018

So where should this call be placed? Doesn't work for me before, after or between initialization and definition of flags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.