Skip to content

Commit

Permalink
Merge pull request #1 from NVIDIA/master
Browse files Browse the repository at this point in the history
Merge
  • Loading branch information
TimZaman authored Oct 4, 2016
2 parents 9f20e01 + f8b74e8 commit c55baa8
Show file tree
Hide file tree
Showing 166 changed files with 2,091 additions and 2,333 deletions.
22 changes: 12 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# Ignore these file types
*.cfg
*.log
*.pyc
# Temporary files
*.swp

# Ignore emacs backup files
*~
TAGS

# Ignore these files
.coverage
# Compiled / optimized files
*.py[cod]

# Tests
/.coverage

# Ignore these directories
# virtualenv
/venv/
/digits/jobs/

# setuptools
/build/
/dist/
/*.egg-info/
9 changes: 7 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,19 @@ install:
- pip install -r requirements.txt
- pip install -r requirements_test.txt

# image gradients plug-ins
- pip install -e .
- pip install plugins/data/imageGradients
- pip install plugins/view/imageGradients

before_script:
- export CAFFE_ROOT=~/caffe
- export TORCH_ROOT=~/torch/install
- export TORCH_ROOT=~/torch
# Disable OpenMP multi-threading
- export OMP_NUM_THREADS=1

script:
./digits-test -v --with-coverage --cover-package=digits,tools,scripts
./digits-test -v --with-coverage --cover-package=digits

after_success:
coveralls
Expand Down
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
recursive-include digits/templates *
recursive-include digits/static *
recursive-include digits/standard-networks *
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,30 @@ DIGITS (the **D**eep Learning **G**PU **T**raining **S**ystem) is a webapp for t

# Installation

If you are using Ubuntu 14.04, you can install pre-built packages for the latest major release.
Visit [docs/UbuntuInstall.md](docs/UbuntuInstall.md) for instructions.
| Installation method | Supported platform[s] | Available versions | Instructions |
| --- | --- | --- | --- |
| Deb packages | Ubuntu 14.04 | [14.04 repo](http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1404/x86_64) | [docs/UbuntuInstall.md](docs/UbuntuInstall.md) |
| Docker | Linux | [DockerHub tags](https://hub.docker.com/r/nvidia/digits/tags/) | [nvidia-docker wiki](https://github.com/NVIDIA/nvidia-docker/wiki/DIGITS) |
| Source | Ubuntu 14.04, 16.04 | [GitHub tags](https://github.com/NVIDIA/DIGITS/releases) | [docs/BuildDigits.md](docs/BuildDigits.md) |

To build DIGITS and its requirements from source, visit [docs/BuildDigits.md](docs/BuildDigits.md) for instructions.
# Usage

Once you have installed DIGITS, visit [docs/GettingStarted.md](docs/GettingStarted.md) for an introductory walkthrough.

Then, take a look at some of the other documentation at [docs/](docs/) and [examples/](examples/):

* [Getting started with Torch](docs/GettingStartedTorch.md)
* [Fine-tune a pretrained model](examples/fine-tuning/README.md)
* [Train an autoencoder network](examples/autoencoder/README.md)
* [Train a regression network](examples/regression/README.md)
* [Train a Siamese network](examples/siamese/README.md)
* [Train a text classification network](examples/text-classification/README.md)
* [Train an object detection network](examples/object-detection/README.md)
* [Learn more about weight initialization](examples/weight-init/README.md)
* [Use Python layers in your Caffe networks](examples/python-layer/README.md)
* [Download a model and use it to classify an image outside of DIGITS](examples/classification/README.md)
* [Overview of the REST API](docs/API.md)

# Get help

### Installation issues
Expand Down
62 changes: 4 additions & 58 deletions digits-devserver
Original file line number Diff line number Diff line change
@@ -1,60 +1,6 @@
#!/usr/bin/env python2
# Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved.
#!/bin/bash
# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.

import argparse
import sys

import digits

if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Run the DIGITS development server')
parser.add_argument('-p', '--port',
type=int,
default=5000,
help='Port to run app on (default 5000)'
)
parser.add_argument('-c', '--config',
action='store_true',
help='Edit the application configuration'
)
parser.add_argument('-d', '--debug',
action='store_true',
help='Run the application in debug mode (reloads when the source changes and gives more detailed error messages)'
)
parser.add_argument('--version',
action='store_true',
help='Print the version number and exit'
)

args = vars(parser.parse_args())

from digits import config

if args['version']:
print digits.__version__
sys.exit()

if args['config']:
config.load_config('normal')
else:
config.load_config('quiet')

from digits.webapp import app, socketio, scheduler

print ' ___ ___ ___ ___ _____ ___'
print ' | \_ _/ __|_ _|_ _/ __|'
print ' | |) | | (_ || | | | \__ \\'
print ' |___/___\___|___| |_| |___/', digits.__version__
print

try:
if not scheduler.start():
print 'ERROR: Scheduler would not start'
else:
app.debug = args['debug']
socketio.run(app, '0.0.0.0', args['port'])
except KeyboardInterrupt:
pass
finally:
scheduler.stop()
set -e

python -m digits $@
26 changes: 0 additions & 26 deletions digits-server

This file was deleted.

3 changes: 3 additions & 0 deletions digits/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/digits.cfg
/jobs/
/digits.log*
5 changes: 4 additions & 1 deletion digits/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
__version__ = '4.1-dev'
# Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved.
from __future__ import absolute_import

from .version import __version__
66 changes: 66 additions & 0 deletions digits/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved.

import argparse
import os.path
import sys


# Update PATH to include the local DIGITS directory
PARENT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
found_parent_dir = False
for p in sys.path:
if os.path.abspath(p) == PARENT_DIR:
found_parent_dir = True
break
if not found_parent_dir:
sys.path.insert(0, PARENT_DIR)


def main():
parser = argparse.ArgumentParser(description='DIGITS server')
parser.add_argument('-p', '--port',
type=int,
default=5000,
help='Port to run app on (default 5000)'
)
parser.add_argument('-d', '--debug',
action='store_true',
help='Run the application in debug mode (reloads when the source changes and gives more detailed error messages)'
)
parser.add_argument('--version',
action='store_true',
help='Print the version number and exit'
)

args = vars(parser.parse_args())

import digits

if args['version']:
print digits.__version__
sys.exit()

print ' ___ ___ ___ ___ _____ ___'
print ' | \_ _/ __|_ _|_ _/ __|'
print ' | |) | | (_ || | | | \__ \\'
print ' |___/___\___|___| |_| |___/', digits.__version__
print

import digits.config
import digits.log
import digits.webapp

try:
if not digits.webapp.scheduler.start():
print 'ERROR: Scheduler would not start'
else:
digits.webapp.app.debug = args['debug']
digits.webapp.socketio.run(digits.webapp.app, '0.0.0.0', args['port'])
except KeyboardInterrupt:
pass
finally:
digits.webapp.scheduler.stop()


if __name__ == '__main__':
main()
22 changes: 14 additions & 8 deletions digits/config/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
# Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved.
from __future__ import absolute_import

import os
# Create this object before importing the following imports, since they edit the list
option_list = {}

# These are the only two functions that the rest of DIGITS needs to use
from .current_config import config_value
from .load import load_config
from . import caffe
from . import gpu_list
from . import jobs_dir
from . import log_file
from . import torch
from . import server_name

if 'DIGITS_MODE_TEST' in os.environ:
# load the config automatically during testing
# it's hard to do it manually with nosetests
load_config()

def config_value(option):
"""
Return the current configuration value for the given option
"""
return option_list[option]

Loading

0 comments on commit c55baa8

Please sign in to comment.