Giter Site home page Giter Site logo

Comments (14)

hughperkins avatar hughperkins commented on June 1, 2024

Hi. You have the same GPU as me, so thats convenient for testing :-) Question: can you provide a minimal python script to reprorduce the problem please? are you using python2.7 or python 3.something?

from deepcl.

hughperkins avatar hughperkins commented on June 1, 2024

(Like, for example, if I try:

from __future__ import print_function
import array
import PyDeepCL
import sys
print('imports done')

if len(sys.argv) != 2:
    print(
        'usage: python ' + sys.argv[0] +
        ' [mnist data directory (containing the .mat files)]')
    sys.exit(-1)

mnistFilePath = sys.argv[1] + '/t10k-images-idx3-ubyte'

cl = PyDeepCL.DeepCL()

print('compute units:', cl.getComputeUnits())
print('local memory size, bytes:', cl.getLocalMemorySize())
print('local memory size, KB:', cl.getLocalMemorySizeKB())
print('max workgroup size:', cl.getMaxWorkgroupSize())
print('max alloc size MB:', cl.getMaxAllocSizeMB())

net = PyDeepCL.NeuralNet(cl, 1, 28)
print('created net')
print(net.asString())
print('printed net')
net.addLayer(PyDeepCL.NormalizationLayerMaker().translate(-0.5).scale(1/255.0))
print('added layer ')
PyDeepCL.NetdefToNet.createNetFromNetdef(
    net, "rt2-8c5z-relu-mp2-16c5z-relu-mp3-150n-tanh-10n")
print(net.asString())


(N, planes, size) = PyDeepCL.GenericLoader.getDimensions(mnistFilePath)
print((N, planes, size))

N = 1280
images = array.array('f', [0] * (N * planes * size * size))
labels = array.array('i', [0] * N)
PyDeepCL.GenericLoader.load(mnistFilePath, images, labels, 0, N)
print('loaded data')

sgd = PyDeepCL.SGD(cl, 0.002, 0.0)
print('created SGD')
sgd.setWeightDecay(0.0001)
netLearner = PyDeepCL.NetLearner(
    sgd, net,
    N, images, labels,
    N, images, labels,
    128)
print('created netLearner')
netLearner.setSchedule(12)
netLearner.run()
print('done, cleaning up...')

... this works ok for me. but coulld be a difference in our compilation options perhaps)

from deepcl.

hughperkins avatar hughperkins commented on June 1, 2024

It sounds like a problem I had, that was fixed actually, which I fixed by converting from string to const char * for ActivationFunction::getDefineName(). can you confirm the git log pleaes?

git log -n 5 --oneline

On my box I get something like:

d45b6de remove include_dirs
573deb7 remove mac build warning for softmaxlayer
f4fad72 remove build warning on mac
e3fb8c7 remove warning on Mac
8dff0d1 remove mac os x build warnings

from deepcl.

maged avatar maged commented on June 1, 2024

Here's my git log:

573deb7 remove mac build warning for softmaxlayer
f4fad72 remove build warning on mac
e3fb8c7 remove warning on Mac
8dff0d1 remove mac os x build warnings
309c543 change directory in travis

And here's a script it will break on:

cl = PyDeepCL.DeepCL()

net = PyDeepCL.NeuralNet(cl, 1, 28)
net.addLayer(PyDeepCL.NormalizationLayerMaker().translate(-0.5).scale(1/255.0))
PyDeepCL.NetdefToNet.createNetFromNetdef(
    net, "rt2-8c5z-tanh-5n")

With relu causing the same error as tanh above. I compiled with cmake -DCMAKE_BUILD_TYPE=Debug .., to force fn to not be optimized out, and it looks like the root issue is a seg fault on any fn->foo() call. Although my repo is up to date, it might be another part of the library I broke (I've recently been playing around a lot with the DeepCL/EasyCL library). I'll try starting with a new install of DeepCL and see if that resolves it.

Thanks for your fast reply!

from deepcl.

maged avatar maged commented on June 1, 2024

I'm getting the same error on a completely new install up to date with the master

d45b6de remove include_dirs
573deb7 remove mac build warning for softmaxlayer
f4fad72 remove build warning on mac
e3fb8c7 remove warning on Mac
8dff0d1 remove mac os x build warnings

from deepcl.

hughperkins avatar hughperkins commented on June 1, 2024

Ok, interesting. Please can you confirm:

  • what OS you are using, and what version?
  • what version of python your are using?

(Update: the test code above runs ok for me. So I guess it is related to some difference in our OS, or python version)

from deepcl.

hughperkins avatar hughperkins commented on June 1, 2024

(Note: I added your test to my Mac OS X travis script ,and seems to work ok: https://travis-ci.org/hughperkins/DeepCL/builds/115800365#L2384 https://github.com/hughperkins/DeepCL/blob/travis-tweaks/travis/simpletest.py#L37 So, seems to work on Ubuntu 15.10, and Mac OS X. I guess that leaves ... Windows?)

from deepcl.

hughperkins avatar hughperkins commented on June 1, 2024

(updated python wrappers slightly to implement __str_ https://travis-ci.org/hughperkins/DeepCL/builds/115806497#L2395 , to give more convincing output )

from deepcl.

hughperkins avatar hughperkins commented on June 1, 2024

(added test for python2.7 too https://travis-ci.org/hughperkins/DeepCL/builds/115809055#L2413 https://travis-ci.org/hughperkins/DeepCL/builds/115809055#L2540 https://github.com/hughperkins/DeepCL/blob/travis-tweaks/.travis.yml#L65-L69 )

from deepcl.

maged avatar maged commented on June 1, 2024

I'm actually using Ubuntu 15.10 with Python 2.7.11 :: Anaconda 2.5.0 (64-bit). Not sure why this only appears on my system... I might've broken something arcane.

from deepcl.

hughperkins avatar hughperkins commented on June 1, 2024

Hmmm, I'm using Ubuntu 15.10 too...

from deepcl.

hughperkins avatar hughperkins commented on June 1, 2024

How about:

pip uninstall -y DeepCL

... and then do a fresh git clone of DeepCL, and rebuild/reinstall?

from deepcl.

maged avatar maged commented on June 1, 2024

Worked :) Thanks for your help debugging (and building the library!)

from deepcl.

hughperkins avatar hughperkins commented on June 1, 2024

Cool :-)

from deepcl.

Related Issues (20)

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.