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

CPU support #2

Open
ruXlab opened this issue Sep 23, 2016 · 7 comments
Open

CPU support #2

ruXlab opened this issue Sep 23, 2016 · 7 comments

Comments

@ruXlab
Copy link

ruXlab commented Sep 23, 2016

Hello

Thanks for releasing source code. I've got problem while running script on laptop without cuda gpu:

Traceback (most recent call last):
  File "NPE.py", line 57, in <module>
    config_module = imp.load_source('config',config_path)
  File "IAN_simple.py", line 10, in <module>
    import lasagne.layers.dnn
  File "/usr/local/lib/python2.7/dist-packages/lasagne/layers/dnn.py", line 14, in <module>
    "requires GPU support -- see http://lasagne.readthedocs.org/en/"
ImportError: requires GPU support -- see http://lasagne.readthedocs.org/en/latest/user/installation.html#gpu-support

How can I enforce CPU mode?

@ruXlab ruXlab changed the title Disable GPU support CPU support Sep 23, 2016
@ajbrock
Copy link
Owner

ajbrock commented Sep 23, 2016

If you remove all my explicit conv2DDNNLayer calls (aliased as C2D) and replace them with standard Conv2D layer calls it should work, but keep in mind that those DeconvLayers are adapted from Radford's DCGAN and make explicit DNN calls, so you would need some workaround for that as I don't think the TransposedConv2D layer will work identically (what with the 5x5 kernels in the DeconvLayers). I've had trouble with it in the past.

@ajbrock
Copy link
Owner

ajbrock commented Sep 28, 2016

I've added support for not explicitly making DNN calls, so you should, presumably, be able to try running this on CPU. At the very least, it shouldn't crash.

@dkandalov
Copy link

Looks like it still fails:

Traceback (most recent call last):
  File "NPE.py", line 53, in <module>
    model = IAN(config_path = 'IAN_simple.py', dnn = True)
  File "API.py", line 21, in __init__
    self.model = config_module.get_model(dnn=dnn)
  File "IAN_simple.py", line 58, in get_model
    import lasagne.layers.dnn
  File "/usr/local/lib/python2.7/site-packages/lasagne/layers/dnn.py", line 15, in <module>
    "requires GPU support -- see http://lasagne.readthedocs.org/en/"
ImportError: requires GPU support -- see http://lasagne.readthedocs.org/en/latest/user/installation.html#gpu-support

@ajbrock
Copy link
Owner

ajbrock commented Dec 20, 2016

@dkandalov Change the dnn=True line on line 53 to dnn=False, and it won't attempt to import cuDNN.

@dacb
Copy link

dacb commented Nov 7, 2017

@ajbrock It appears the correct line for this change is 18.

@ajbrock
Copy link
Owner

ajbrock commented Nov 7, 2017

Yes, following a commit after the above comments, the proper line for this is now 18.

@dacb
Copy link

dacb commented Nov 7, 2017

Might want to update the README

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

No branches or pull requests

4 participants