Skip to content

(1)raise ValueError(reduction + " is not a valid value for reduction") (2)dists[c, n] = torch.dist(preds[n,c,:], target[n,c,:])/normalize[n] RuntimeError: Expected object of type torch.FloatTensor but found type torch.cuda.FloatTensor for argument #2 'other' #68

@unclejokerjoker

Description

@unclejokerjoker

There are two bugs in the latest repo updated on Jan 8th,2019.The first one is as the title described.I think it is caused by the pytorch version 0.4.1 vs 1.0 .
I solved this problem by changing the param of the torch.nn.MSELoss() to 'size_average=True'

The second bug is :
'dists[c, n] = torch.dist(preds[n,c,:], target[n,c,:])/normalize[n]
RuntimeError: Expected object of type torch.FloatTensor but found type torch.cuda.FloatTensor for argument #2 'other''
It is caused by the type of the variable.I solved it by changing the type of variable 'target' from cuda() to cpu data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions