extensions.ParameterStatistics cannot work with default parameter in GPU mode
See original GitHub issueextensions.ParameterStatistics
raise error in GPU mode at numpy.count_nonzero
or numpy.percentile
at https://github.com/chainer/chainer/blob/master/chainer/training/extensions/parameter_statistics.py#L106
The type of link.param
is cupy.ndarray but these functions cannot take this type.
Other functions (like numpy.mean) use the instance method (like hoge.mean).
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
python - Problem with Functions which has default parameter(s)
This code executed then let say, I want to change my default arguments of my function named Veli. I cannot do this with...
Read more >Default parameters - JavaScript - MDN Web Docs
Default function parameters allow named parameters to be initialized with default values if no value or undefined is passed.
Read more >CA1026: Default parameters should not be used
The compiler ignores the values of default parameters for Managed Extension for C++ when it accesses managed code. The Visual Basic compiler ...
Read more >Getting Hurt With Swift Protocol Extensions & Default ...
Of course, Swift protocol extensions and default parameter values are great features. And they are always safe, aren't they?
Read more >Multi GPU use not working with modules & extensions
I'm currently trying to run the following code: import torch from torch.autograd import Function from torch.autograd.gradcheck import ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@hvy That’s great! Thanks a lot!
I am not sure this is an efficient way, but in my environment, the issue might be solved by simply wrapping params (at line 106 in parameter_statistics.py) by chainer.cuda.to_cpu, i.e., rewriting the line into
value = function(chainer.cuda.to_cpu(params))
withimport chainer