Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Check for `_keras_dir` (`.keras`) in current working directory #12063

loisaidasam opened this Issue Jan 17, 2019 · 1 comment


None yet
4 participants
Copy link

commented Jan 17, 2019

Currently, if KERAS_HOME is explicitly set, _keras_dir will use that value.

Otherwise, it defaults to the user's home directory (~) with a fallback to /tmp.

What I'm proposing is checking for a .keras directory in the current working directory before defaulting to ~ or falling back to /tmp.

This change would make switching between backends and other specific configs for different projects much simpler!

Here is the current workflow:

# Set Keras base dir path given KERAS_HOME env variable, if applicable.
# Otherwise either ~/.keras or /tmp.
if 'KERAS_HOME' in os.environ:
_keras_dir = os.environ.get('KERAS_HOME')
_keras_base_dir = os.path.expanduser('~')
if not os.access(_keras_base_dir, os.W_OK):
_keras_base_dir = '/tmp'
_keras_dir = os.path.join(_keras_base_dir, '.keras')

If this ticket gets approved I'm happy to submit a PR.

@JoshuaRM JoshuaRM referenced this issue Jan 24, 2019


Issue 12063 #12127

1 of 4 tasks complete

This comment has been minimized.

Copy link

commented Feb 8, 2019

What is the use case for this? If you want to quickly change the config (and directories) what prevents you from using the environement variable?

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.