I have tried a bunch of things I’ve found on forums to fix this issue but nothing is working. I’m getting this error trying to run my model.
Notebook is public here:
https://drive.google.com/file/d/1akU15oJrzFi9KsY3oyrstmvf9tW_8mpS/view?usp=sharing 2
ERROR:

Epoch:   0%|          | 0/4 [00:00<?, ?it/s]
RuntimeError                              Traceback (most recent call last)
 in 
30     # Backward pass
31     torch.set_default_dtype(torch.float64)
—> 32     loss.backward()
33     # Update parameters and take a step using the computed gradient
34     optimizer.step()
1 frames
/opt/conda/lib/python3.7/site-packages/torch/autograd/init.py in backward(tensors, grad_tensors, retain_graph, create_graph, grad_variables)
130     Variable.execution_engine.run_backward(
131         tensors, grad_tensors, retain_graph, create_graph,
 → 132         allow_unreachable=True)  # allow_unreachable flag
133
134
RuntimeError: Found dtype Double but expected Float