GithubHelp home page GithubHelp logo

Comments (3)

fliuzzi avatar fliuzzi commented on September 26, 2024

To add to this, even when i seem to set up the gpu and config perfectly and without errors, it just doesn't run at all, and is obviously still using the CPU. Here are two runs: the first i use the gpu device and the second i use the cpu


ubuntu@ip-10-13-207-39:/mnt/frankie/optimus$ time python train.py sample/configs/sampleNonStaticConfig.json sample/datasets/sst_small_sample.csv sample/myFirstModel.p true
Using gpu device 0: GRID K520
Converted word vectors to word_idx_map
Converted the dataset into matrix. Num Rows = 300 Num labels = 2
Parameters for model: [('image shape', 64, 300), ('filter shape', [(100, 1, 3, 300), (100, 1, 4, 300), (100, 1, 5, 300)]), ('hidden_units', []), ('dropout', 0.5), ('batch_size', 50), ('learn_decay', 0.95), ('conv_non_linear', u'relu'), ('mode', u'nonstatic'), ('sqr_norm_lim', 9), ('shuffle_batch', True), ('n_epochs', 5)]
epoch 1, train perf 65.600000 %, val perf 48.000000
epoch 2, train perf 50.800000 %, val perf 40.000000
epoch 3, train perf 50.800000 %, val perf 40.000000
epoch 4, train perf 56.400000 %, val perf 44.000000
epoch 5, train perf 88.400000 %, val perf 68.000000
Training finished. Best model is at sample/myFirstModel.p

real 1m26.142s
user 1m24.769s
sys 0m1.841s

__________________AND WITH CPU ...

ubuntu@ip-10-13-207-39:/mnt/frankie/optimus$ nano ~/.theanorc
ubuntu@ip-10-13-207-39:/mnt/frankie/optimus$ time python train.py sample/configs/sampleNonStaticConfig.json sample/datasets/sst_small_sample.csv sample/myFirstModel.p true
Converted word vectors to word_idx_map
Converted the dataset into matrix. Num Rows = 300 Num labels = 2
Parameters for model: [('image shape', 64, 300), ('filter shape', [(100, 1, 3, 300), (100, 1, 4, 300), (100, 1, 5, 300)]), ('hidden_units', []), ('dropout', 0.5), ('batch_size', 50), ('learn_decay', 0.95), ('conv_non_linear', u'relu'), ('mode', u'nonstatic'), ('sqr_norm_lim', 9), ('shuffle_batch', True), ('n_epochs', 5)]
epoch 1, train perf 65.600000 %, val perf 48.000000
epoch 2, train perf 50.800000 %, val perf 40.000000
epoch 3, train perf 50.800000 %, val perf 40.000000
epoch 4, train perf 56.400000 %, val perf 44.000000
epoch 5, train perf 88.400000 %, val perf 68.000000
Training finished. Best model is at sample/myFirstModel.p

real 1m26.366s
user 1m24.861s
sys 0m1.906s

from optimus.

devashishshankar avatar devashishshankar commented on September 26, 2024

The code should work seamlessly on GPUs. I have tested it. The only changes you have to make are for Theano. (E.g. FloatX=float32 and device=gpu0). Seems from your outputs, you were able to run on GPUs. You won't see GPU speedup on such a small dataset. This is because some time is spent on setting up GPUs, copying data from CPU memory to GPU memory, etc.

Did you try on a larger dataset?

from optimus.

devashishshankar avatar devashishshankar commented on September 26, 2024

Hi, Thanks for notifying this! There actually was a bug when using GPUs. Using floatX = float64 is not the correct solution and makes it use CPUs. This should be fixed now.

from optimus.

Related Issues (8)

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.