Skip to content

RuntimeError: Found dtype Long but expected Float #28

@Dyongh613

Description

@Dyongh613

File "train.py", line 122, in main
model_update(model, step, G_loss, optG_fs2)
File "train.py", line 77, in model_update
loss = (loss / grad_acc_step).backward()
File "C:\Users\12604\Anaconda3\envs\pytorch\lib\site-packages\torch\tensor.py", line 221, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph)
File "C:\Users\12604\Anaconda3\envs\pytorch\lib\site-packages\torch\autograd_init_.py", line 132, in backward
allow_unreachable=True) # allow_unreachable flag
RuntimeError: Found dtype Long but expected Float

Hi@keonlee9420. This problem occurs when the loss function is back-propagating, how can I solve it?
This is the dtype of loss
image

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