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

RMSE analyzer bug #79

Open
michaelmacisaac opened this issue Oct 6, 2022 · 1 comment
Open

RMSE analyzer bug #79

michaelmacisaac opened this issue Oct 6, 2022 · 1 comment

Comments

@michaelmacisaac
Copy link

Describe the bug
With the current RMSE analyzer, when one runs it an error occurs in the "_to_numpy" function. The error is on the line with the modification:
x[0].detach().numpy()

The error is prompted because there is a complication with converting a cuda tensor to a numpy array.

My work around is simple. simply modify to:
x[0].detach().cpu().numpy()

this sends the data to the cpu.

An additional error I encountered was in the RMSE.py script from lines 160-164. Here an error associated with the print command occurred. The issue seemed to be resolved when I replaced the use of ".format()" with the use of f-strings.
image

To Reproduce
To reproduce, run the current RMSE analyzer

Expected behavior
RMSE analyzer should calculate the RMSE

Screenshots

_to_numpy function mod:

def _to_numpy(x, compute_argument):
"""
Convert to a numpy array from a tensor.

`compute_argument` is needed to determine whether ``x`` is a list of tensor of a numpy
array.
"""
if isinstance(compute_argument, Iterable):
    return x[0].detach().cpu().numpy() #added '.cpu()'
else:
    return x

Additional context
Windows operating system
Python 3.7

@mjwen
Copy link
Collaborator

mjwen commented Oct 7, 2022

Thanks @michaelmacisaac!

I can confirm that the error related to _to_numpy() is a bug. The script is created without considering gpu and yours is correct. Can you make a PR to correct this?

For the string error, I cannot reproduce it on Mac and Linux. Not sure why it does not work on Win. Are you using linux subsystem on Win?

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

2 participants