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

Fix Issue #11384 - Explaining how to load external backends in the documentation #11405

Merged
merged 5 commits into from
Nov 18, 2018

Conversation

JoshuaRM
Copy link
Contributor

Summary

Created additional documentation for the "Switching from one backend to another" section of the documentation, including an example of an edited keras.json configuration file.

Related Issues

Solves issue #11384

PR Overview

  • This PR requires new unit tests [y/n] (make sure tests are included)
  • This PR requires to update the documentation [y/n] (make sure the docs are up-to-date)
  • This PR is backwards compatible [y/n]
  • This PR changes the current API [y/n] (all API changes need to be approved by fchollet)

Sorry, something went wrong.

Added documentation for loading an external backend
Documentation added to "Switching from one backend to another" section of documentation
@JoshuaRM
Copy link
Contributor Author

Not sure why the most recent commit failed the travis CI testing, as the commit just before that managed to pass. The latest commit passes all tests except for Python 3.6 KERAS_BACKEND=cntk PYTHONWARNINGS=ignore. If anyone has any solutions please let me know

@gabrieldemarmiesse
Copy link
Contributor

Currently, the travis build has a random timout which we have no information about. It's been there for a while and we have no idea how to fix it. So it can happend that the build fails randomly with the message "no output has been recieved since 10 minutes".

@gabrieldemarmiesse
Copy link
Contributor

@farizrahman4u I'll let you review it if you don't mind. I think you're better fitted for the task.

@farizrahman4u
Copy link
Contributor

@gabrieldemarmiesse Its supposed to be a module from a package rather than a standalone file. Like "backend": "mxnet.keras", assuming mxnet guys have added a keras sub module which is a valid backend.

@@ -45,6 +45,22 @@ KERAS_BACKEND=tensorflow python -c "from keras import backend"
Using TensorFlow backend.
```

In keras it is possible to load more backends than `"tensorflow"`, `"theano"`, and `"cntk"`. keras can use external backends as well, and this can be performed by changing the `keras.json` configuration file, and the `"backend"` setting. Suppose you have a python file called mxnet_backend.py that you wanted to use as your external backend. The `keras.json` configuration file would be changed as follows:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MXNet is not a good example, because there is, in fact, a Keras MXNet which is a fork and cannot be used as Keras backend.

@gabrieldemarmiesse
Copy link
Contributor

@farizrahman4u do you have an example of backend which is working is ready to be loaded with this method?

@farizrahman4u
Copy link
Contributor

farizrahman4u commented Nov 4, 2018

@gabrieldemarmiesse The one for which I made this change is not open source (yet) :(

@gabrieldemarmiesse
Copy link
Contributor

Ok I suppose that we can suppose that we have a backend called my_package.my_backend.

@JoshuaRM Can you replace mxnet by this dummy backend my_package.my_backend? Thank you.

@gabrieldemarmiesse
Copy link
Contributor

@farizrahman4u Could you review? I pushed a commit so I can't review this PR.

Copy link
Contributor

@farizrahman4u farizrahman4u left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect.

@gabrieldemarmiesse gabrieldemarmiesse merged commit dc9e510 into keras-team:master Nov 18, 2018
kiku-jw pushed a commit to kiku-jw/keras that referenced this pull request Mar 4, 2019
… in the documentation (keras-team#11405)

* Update backend.md

Added documentation for loading an external backend

* Added documentation for using an external backend

* Added documentation for loading external backends

* Added documentation to correct section

Documentation added to "Switching from one backend to another" section of documentation

* Used a dummy name for the module containing the backend.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants