question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

extensions.ParameterStatistics cannot work with default parameter in GPU mode

See original GitHub issue

extensions.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:closed
  • Created 6 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
t-sakai-kurecommented, Feb 18, 2018

@hvy That’s great! Thanks a lot!

1reaction
t-sakai-kurecommented, Oct 9, 2017

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)) with import chainer

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found