Comments (5)
Right now you're basically not supposed to pass use_cudnn
in the general case -- just pass nothing, and cuDNN will be used if it's feasible.
Passing use_cudnn=True
is something you'd only do if you want to error out when cuDNN isn't available, as opposed to falling back to a non-cuDNN implementation.
I propose to alleviate this we always provide a reason why cudnn was not used.
Definitely, this is a good call. There are multiple user-facing factors at play, like recurrent dropout, masking (which will actually give you a targeted error message), activations, etc. And of course availability of cuDNN in your environment.
from keras.
Right now you're basically not supposed to pass use_cudnn in the general case -- just pass nothing, and cuDNN will be used if it's feasible.
I guess what I'd be hoping to gain from an additional API here would be to express in code:
"I want to make sure that my Keras code is not the reason that we aren't using cudnn.
If the backend/environment doesnt support it, that is alright -
but I want to make sure I do not accidentally have the flags misconfigured"
though, perhaps just improving the error messages is sufficient
from keras.
Hey @LukeWood ,
I want to make sure that my Keras code is not the reason that we aren't using cudnn
That's how I look at the use_cudnn
argument. It really means "fail if you can't use cudnn".
though, perhaps just improving the error messages is sufficient
I think that's the right call. Are you willing to contribute on this?
from keras.
yes happy to contribute!
It really means "fail if you can't use cudnn".
I think the key difference is that to me there are actually two intentions users may want to express. One is "fail if you can't use cudnn, regardless of cause" - one is "fail if I can't use cudnn, due to my own configuration of the RNN layer". I think they're nuancedly different, but that the difference is actually meaningful. Perhaps what I mean here would be clarified via code, but I think there is a meaningful difference between these two intentions.
Regardless, happy to contribute error message improvements.
from keras.
Regardless, happy to contribute error message improvements.
Sure, please open a PR if you're able. We probably need to make two backend functions, is_config_cudnn_compatible
and is_cudnn_available
-- or maybe pass appropriate info in the NotImplementedError
exception message.
from keras.
Related Issues (20)
- I wrote a custom layer like this and i am not confident of serializing this layer finally, how to write this in best way? HOT 1
- "Keras.wrappers" <module not found error> in 'python IDLE 3.12.0' HOT 4
- Custom Generator crash for variable input dimensions HOT 4
- Add `on_epoch_begin` to `utils.Sequence` HOT 1
- Conv3D generates output on Tensorflow backend while crashes on pytorch backend HOT 2
- RNN layer: len is not well defined for a symbolic Tensor. Please call `x.shape` rather than `len(x)` for shape information. HOT 3
- keras.ops.select doesn't accept tuples as input HOT 1
- Recommendation for writing tests for ModelParallel distribution HOT 2
- optimizers.Adam no longer accepts tf.Variable HOT 1
- Please explain label_mode='int' in keras.utils.image_dataset_from_directory HOT 2
- Getting Nan values in prediction HOT 1
- compatibility with pytorch 2.3
- Specifying shape of normal sampling with partially empty keras tensor HOT 3
- Question: Best practice for direct variable initialization HOT 5
- Inconsistent assertion in keras.layers.MultiHeadAttention
- [BUG] keras.layers.StringLookup and Vocabulary of Tensors HOT 3
- model.export() fails to save output layer name in the SavedModel HOT 8
- ops.linspace broken in Tensorflow when num is a tf.Tensor HOT 4
- Loading model fails: can only concatenate tuple
- model.predict time stdout HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from keras.