Skip to content
Discussion options

You must be logged in to vote

I just solved this actually - the problem was that the tensor in data[0] was dtype uint8 and the working tensor was dtype float32. Even though they are different datatypes the tensors were showing up as equal because they had the same values. My problem was solved by adding this simple .float() line:

data = np.expand_dims(data_zoom, axis=0)
data = torch.from_numpy(data)
data = data.float()
data = [data.to(device)]

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by KumoLiu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #6563 on May 31, 2023 02:54.