Coder Social home page Coder Social logo

chainer / chainerui Goto Github PK

View Code? Open in Web Editor NEW
170.0 21.0 30.0 26.78 MB

ChainerUI: User Interface for Chainer

License: MIT License

Python 52.39% Mako 0.11% CSS 0.23% HTML 0.19% JavaScript 38.57% Dockerfile 0.22% Shell 0.07% TypeScript 8.22%

chainerui's Introduction

ChainerUI

PyPI Build Status Build status Coverage Status Documentation Status

training_captures

ChainerUI is a visualization and management tool for Chainer.

Installation

To install ChainerUI, use pip.

$ pip install chainerui

To install ChainerUI from source.

$ git clone https://github.com/chainer/chainerui.git
$ cd chainerui/frontend
$ npm install && npm run build && cd ..
$ pip install -e .
  • ChainerUI uses sqlite3 module which is included in the standard Python library. If Python is built from source, sqlite3 must be installed before building Python.
    • On Ubuntu, "libsqlite3-dev" must be installed before building Python ($ apt-get install libsqlite3-dev).
    • On Windows, install Visual C++ Build Tools with the Default Install setting before building Python.

Usage

  1. output log file with LogReport extension, see examples/log-file/train_mnist.py
  2. output log file manually, see examples/log-file/train_mnist_custom_loop.py
  3. post training logs via web API, see examples/web-api/train_mnist.py

Quick start

Initialize ChainerUI database.

$ chainerui db create
$ chainerui db upgrade

Clone examples of train log and create a project.

$ git clone https://github.com/chainer/chainerui.git
$ cd chainerui

$ # create example project
$ chainerui project create -d examples/log-file -n example-project

$ # run ChainerUI server
$ chainerui server

Open http://localhost:5000/ and select "example-project", then shown a chart of training logs.

For more detailed usage, see getting started

Docker start

Get Docker container from DockerHub and start ChainerUI server. The container has installed ChainerUI module, setup a DB and a command to start the server.

$ # replace tag to the latest version number
$ docker pull chainer/chainerui:latest
$ docker run -d -p 5000:5000 --name chainerui chainer/chainerui:latest
$ # then ChainerUI server is running

Open http://localhost:5000/, shown empty project list. examples/web-api/train_mnist.py is an example to setup project and send logs via web API.

For more detailed usage, see getting started or web API

Browser compatibility

ChainerUI is supported by the latest stable version of the following browsers.

  • Firefox
  • Chrome

License

MIT License (see LICENSE file).

Contribution

Any contribution to ChainerUI is welcome!

Run tests

Install "pytest" package and run test

$ pytest

Build client side JS

$ cd frontend
$ npm install
$ npm run build:watch

chainerui's People

Contributors

aidy1991 avatar bartzi avatar cafeal avatar colspan avatar corochann avatar dependabot[bot] avatar disktnk avatar gky360 avatar hakuyume avatar makky3939 avatar mannykayy avatar marevol avatar mottodora avatar nejigane avatar ofk avatar scarletrunner7000 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chainerui's Issues

All CI jobs are failed

ERROR: /home/travis/build/chainer/chainerui/setup.cfg:11: requires pytest-3.4, actual pytest-3.10.0'

Fail to run MNIST example

branch: master (9bd4a961a03b9f7dfc388c6c04024448de8ba0bb)

$ python train_mnist.py -o result_temp
Traceback (most recent call last):
  File "train_mnist.py", line 14, in <module>
    from chainerui.extensions import CommandsExtension
  File "/mnt/c/Development/gopath/src/github.com/chainer/chainerui/chainerui/extensions/__init__.py", line 1, in <module>
    from chainerui.extensions.commands_extension import CommandsExtension  # NOQA
  File "/mnt/c/Development/gopath/src/github.com/chainer/chainerui/chainerui/extensions/commands_extension.py", line 8, in <module>
    from chainerui.utils.command_item import CommandItem
  File "/mnt/c/Development/gopath/src/github.com/chainer/chainerui/chainerui/utils/__init__.py", line 1, in <module>
    from chainerui.utils.command_item import CommandItem  # NOQA
  File "/mnt/c/Development/gopath/src/github.com/chainer/chainerui/chainerui/utils/command_item.py", line 6, in <module>
    from chainerui.models.command import Command
  File "/mnt/c/Development/gopath/src/github.com/chainer/chainerui/chainerui/models/__init__.py", line 4, in <module>
    from chainerui.models.project import Project  # NOQA
  File "/mnt/c/Development/gopath/src/github.com/chainer/chainerui/chainerui/models/project.py", line 11, in <module>
    from chainerui.tasks import collect_results
  File "/mnt/c/Development/gopath/src/github.com/chainer/chainerui/chainerui/tasks/__init__.py", line 2, in <module>
    from chainerui.tasks.crawl_result import crawl_result  # NOQA
  File "/mnt/c/Development/gopath/src/github.com/chainer/chainerui/chainerui/tasks/crawl_result.py", line 10, in <module>
    from chainerui.utils.command_item import CommandItem
ImportError: cannot import name 'CommandItem'

Toggle options for axis

Hi chainerUI developers!

I want to toggle between display and hide axes because there are many metrics in my experimental setting.

2018-02-15 12 16 56

What do you think about it?

multiple graphs

Hi,
great work with chainerui

Is it possible to visualise multiple graphs.

e.g. Losses on one graph and Accuracy on the other?

Support permanent link to share a result with other people

When we use ChainerUI in order to share results of training in our team, we need permanent link feature to share a result in the same graph condition. (Maybe this is also useful to share with oneself after some days or some weeks)

For example, the permanent link should include:

  • which metrics is selected as each axis
  • which results are selected
    and so on...

(ChainerUI has a lot of parameters to show a graph of results, so is it difficult to design permanent link?)

UI is broken

The vertical positions of the checkbox are broken.

2018-09-26 11 34 11

2018-09-26 11 34 46

Result names in the table remain truncated even after the `name` column is expanded

Thank you for making ChainerUI, it is really useful ๐Ÿฐ

Let me just report a couple of things that I noticed.

For some results that have longer names, the name is truncated (ends in ellipsis). Even after dragging the name column to expand it, the name is not shown non-truncated, somewhat counter-intuitive to other table UIs.

screenshot 2018-09-18 15 00 43

API returns 500 when the db is not created yet

I encountered the following error when I see http://localhost:5000 before creating the db.

[2017-12-24 16:25:33,620] ERROR in app: Exception on /api/v1/projects [GET]
Traceback (most recent call last):
  File "/Users/inagaki/.pyenv/versions/anaconda3-4.3.1/envs/ml/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1182, in _execute_context
    context)
  File "/Users/inagaki/.pyenv/versions/anaconda3-4.3.1/envs/ml/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 470, in do_execute
    cursor.execute(statement, parameters)
sqlite3.OperationalError: no such table: project

screen shot 2017-12-24 at 16 27 59

Managing training jobs

This article mentioned the management of training jobs via the chainerui. Specifically:

To operate training jobs, set CommandsExtension in the training script. This extension supports taking a snapshot and changing hyperparameters such as learning rate while running the training job.

I have been trying to change the learning rate, number of epochs and take snapshots without success. Is this functionality available and if so, how can it be used?

pkg_resources.ContextualVersionConflict between Flask, werkzeug

I installed chainerui by the following commnads,

pip install chainerui
chainerui servser

but I caught the following error

pkg_resources.ContextualVersionConflict: (Werkzeug 0.12.2 (/home/hiroshimatsui/.pyenv/vers
ions/3.6.5/envs/bilstm-chainer/lib/python3.6/site-packages), Requirement.parse('Werkzeug>=
0.14'), {'Flask'})

flask 1.0.2 has requirement Werkzeug>=0.14.

Which version of flask is needed for chainerui?

Better Documentation and more examples

It would be helpful to have better documentation and more examples scripts detailing how to use chainerui.

I am currently not sure which training hyper-parameters can be changed via the CommandsExtension.
Can we only change hyper-parameters to do with the optimiser or can we also change things like the batch size during training?
Can we attach custom hyper-parameters to be tuned via chainerui?

If so, how is this done?

show images and visualise network structure

I am assuming that this will become the main visualisation tool for chainer.

In that case, it would be nice if we had the ability to view images directly in chainerui, this is especially handy when tracking the progress of generative models.

Being able to visualise a network (sub)-structure would be handy too.

should have a unique "key" prop error on result detail page

I've got the following error on result detail page.

Warning: Each child in an array or iterator should have a unique "key" prop. See https://fb.me/react-warning-keys for more information.
    in dl (created by Args)
    in div (created by Args)
    in div (created by Args)
    in Args (created by ResultDetail)
    in div (created by ResultDetail)
    in div (created by ResultDetail)
    in div (created by Container)
    in Container (created by ResultDetail)
    in div (created by ResultDetail)
    in ResultDetail (created by Connect(ResultDetail))
    in Connect(ResultDetail) (created by RouterContext)
    in RouterContext (created by Router)
    in Router (created by Root)
    in Provider (created by Root)
    in Root
    in AppContainer

Cannot see the log including NaN

ChainerUI will stop by the log including NaN.

cf.

$ python
>>> json.dumps([float('nan')])
'[NaN]'

$ node
> JSON.parse('[NaN]')
SyntaxError: Unexpected token N in JSON at position 1

Exception when access GET API with no project on DB

When DB has no project, and access to GET API like /api/v1/projects/1/results , ChainerUI server occurs an exception.

Server log:

127.0.0.1 - - [28/Dec/2017 19:52:15] "GET /api/v1/projects/1/results HTTP/1.1" 500 -
[2017-12-28 19:52:20,226] ERROR in app: Exception on /api/v1/projects/1/results [GET]
Traceback (most recent call last):
  File "/root/venv/chainerui/lib/python3.5/site-packages/Flask-0.12.2-py3.5.egg/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/root/venv/chainerui/lib/python3.5/site-packages/Flask-0.12.2-py3.5.egg/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/root/venv/chainerui/lib/python3.5/site-packages/Flask-0.12.2-py3.5.egg/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/root/venv/chainerui/lib/python3.5/site-packages/Flask-0.12.2-py3.5.egg/flask/_compat.py", line 33, in reraise
    raise value
  File "/root/venv/chainerui/lib/python3.5/site-packages/Flask-0.12.2-py3.5.egg/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/root/venv/chainerui/lib/python3.5/site-packages/Flask-0.12.2-py3.5.egg/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/root/venv/chainerui/lib/python3.5/site-packages/Flask-0.12.2-py3.5.egg/flask/views.py", line 84, in view
    return self.dispatch_request(*args, **kwargs)
  File "/root/venv/chainerui/lib/python3.5/site-packages/Flask-0.12.2-py3.5.egg/flask/views.py", line 149, in dispatch_request
    return meth(*args, **kwargs)
  File "/root/venv/chainerui/lib/python3.5/site-packages/chainerui-0.1.1-py3.5.egg/chainerui/views/result.py", line 23, in get
    collect_results(project)
  File "/root/venv/chainerui/lib/python3.5/site-packages/chainerui-0.1.1-py3.5.egg/chainerui/tasks/collect_results.py", line 46, in collect_results
    if (now - project.updated_at).total_seconds() < 4 and (not force):
AttributeError: 'NoneType' object has no attribute 'updated_at'
127.0.0.1 - -[28/Dec/2017 19:52:15] "GET /api/v1/projects/1/results HTTP/1.1" 500 -

Add more key for x-axis

Some train loops do not have epoch and iteration key, for example, reinforcement learning. Current ChainerUI fixes x-axis key (epoch, iteration, and elapsed_time) so, ChainerUI cannot support these training loops. refs #27

It is better that user can select any x-axis keys but this is heavy task a little, so we decided to add more keys on default for x-axis. We got an advice from ChainerRL team, and will add episode and step for x-axis key on default.

Visualize images generated in training phase

This issue is for tracking the implements for Image API, which helps users to show images generated in training phase. I split the feature to several PRs.

  • Server side API design: #83
  • add base view on frontend: #83
  • return error on view, ex) not install PIL, not have images or any other
  • cache PNG data to DB: #119
  • polling to call GET API to automatically update
  • lazy load to image
  • upload images to show already existed
  • more effective UI design
  • place a link to access the images page
  • user guide
  • examples

Wrong project's plot when moving to another page

When I move to project A's page to project B's page,
A's plot remains on the page until the browser finishes loading B's log from the server.

This issue occurs especially when B's log is heavy.

Show module version

  1. should support $ chainerui --version
  2. should support $ python -c "import chainerui; print(chainerui.__version__)"

Uncaught Error: React is running in production mode

I encountered an error in javascript console.

My environment is:

  • Browser: Google Chrome
  • ChainerUI version: v0.2.0

screen shot 2018-02-19 at 2 48 30

Uncaught Error: React is running in production mode, but dead code elimination has not been applied. Read how to correctly configure React for production: https://fb.me/react-perf-use-the-production-build
    at <anonymous>:21:35

Graph style for yLeftAxis and yRightAxis is the same

This is a feature request. I felt if the style of the graphs of yRightAxis is different than yLeftAxis (e.g. dashed or dotted), it would be easier to distinguish them. Currently both are solid and the same colour which is somewhat confusing.

Broken log file halts other log files' rendering

When the project includes the broken log file, I would like to know the log file is broken on ChainerUI.
At worst I want to view other log files that are not broken. ChainerUI should skip to parse broken log files.

Current:

127.0.0.1 - - [02/May/2018 16:17:40] "GET /api/v1/projects/6/results HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/Users/ofk/.pyenv/versions/anaconda3-4.2.0/envs/sandbox/lib/python3.5/site-packages/flask/app.py", line 1997, in __call__
    return self.wsgi_app(environ, start_response)
  File "/Users/ofk/.pyenv/versions/anaconda3-4.2.0/envs/sandbox/lib/python3.5/site-packages/flask/app.py", line 1985, in wsgi_app
    response = self.handle_exception(e)
  File "/Users/ofk/.pyenv/versions/anaconda3-4.2.0/envs/sandbox/lib/python3.5/site-packages/flask/app.py", line 1540, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/ofk/.pyenv/versions/anaconda3-4.2.0/envs/sandbox/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/Users/ofk/.pyenv/versions/anaconda3-4.2.0/envs/sandbox/lib/python3.5/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/ofk/.pyenv/versions/anaconda3-4.2.0/envs/sandbox/lib/python3.5/site-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/ofk/.pyenv/versions/anaconda3-4.2.0/envs/sandbox/lib/python3.5/site-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/ofk/.pyenv/versions/anaconda3-4.2.0/envs/sandbox/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/Users/ofk/.pyenv/versions/anaconda3-4.2.0/envs/sandbox/lib/python3.5/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/ofk/.pyenv/versions/anaconda3-4.2.0/envs/sandbox/lib/python3.5/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/Users/ofk/.pyenv/versions/anaconda3-4.2.0/envs/sandbox/lib/python3.5/site-packages/flask/views.py", line 84, in view
    return self.dispatch_request(*args, **kwargs)
  File "/Users/ofk/.pyenv/versions/anaconda3-4.2.0/envs/sandbox/lib/python3.5/site-packages/flask/views.py", line 149, in dispatch_request
    return meth(*args, **kwargs)
  File "/Users/ofk/git/chainerui/chainerui/views/result.py", line 36, in get
    result = crawl_result(result.id)
  File "/Users/ofk/git/chainerui/chainerui/tasks/crawl_result.py", line 79, in crawl_result
    crawled_result = crawl_result_path(current_result.path_name, is_updated)
  File "/Users/ofk/git/chainerui/chainerui/tasks/crawl_result.py", line 38, in crawl_result_path
    result['logs'] = load_result_json(result_path, 'log')
  File "/Users/ofk/git/chainerui/chainerui/tasks/crawl_result.py", line 22, in load_result_json
    _list = json.load(json_data)
  File "/Users/ofk/.pyenv/versions/anaconda3-4.2.0/envs/sandbox/lib/python3.5/json/__init__.py", line 268, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "/Users/ofk/.pyenv/versions/anaconda3-4.2.0/envs/sandbox/lib/python3.5/json/__init__.py", line 319, in loads
    return _default_decoder.decode(s)
  File "/Users/ofk/.pyenv/versions/anaconda3-4.2.0/envs/sandbox/lib/python3.5/json/decoder.py", line 342, in decode
    raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 8 column 6 (char 179)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.