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

better error message for cuda_convnet import #882

Closed

Conversation

ReyhaneAskari
Copy link
Contributor

Regarding #866.

Copy link
Member

@f0k f0k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the start and sorry for the delay! It's not fully complete yet, but close.

# check if Theano's old GPU backend is available and in use
try:
from theano.sandbox.cuda.basic_ops import gpu_contiguous
except:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be except ImportError. A naked except: will even catch a CTRL+C by the user.

try:
from theano.sandbox.cuda.basic_ops import gpu_contiguous
except:
raise NotImplementedError(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we should raise an ImportError instead.

"cuda_convnet is not supported under Theano's new GPU backend. "
"Ordinary convolutional or pooling convolutional and pooling layers "
"can be used (they are usually faster). Also you can downgrade "
"Theano to version 0.9 and use its old GPU backend)")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be a period (.) instead of the mismatched closing bracked ()).

from theano.sandbox.cuda.basic_ops import gpu_contiguous
# check if Theano's old GPU backend is available and in use
try:
from theano.sandbox.cuda.basic_ops import gpu_contiguous
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't check whether it's in use. import lasagne.layers.cuda_convnet should also fail on Theano 0.8 or 0.9 with device=cuda, not only on Theano 0.10.

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

Successfully merging this pull request may close these issues.

None yet

2 participants