How to change dtype Double to dtype Float? (FIXED)

Hey, I am on lesson 3. I am stuck on a run time error for hours now. Can anyone please help me.

1 Like

I’ve had similar type of issues.
Are you sure img (the argument you are passing to the get_ip function) is a tensor of type double?

Otherwise

omg = torch.Tensor([2, 3, 4]).type(torch.FloatTensor)

2 options:

img.double() 

or

img.to(torch.double)

the img (the argument that I am passing to the get_ip function) is a ImageObject Type

Okay I have managed to fix the issue.
After changing the dtype to np.float32 from np.float64. I noticed @ Mikhail Gurevich had worked on the same dataset. I looked at how he processed the face points coords.

If anyone is reading this and having the same problem and working on the same dataset: Read the thread below

ImagePoints problem with Kaggle Cat Dataset (Facial features recognition)

2 Likes