Skip to content

Scalar Type Error #1950

Answered by AdeelH
natedailey7 asked this question in Q&A
Oct 3, 2023 · 1 comments · 12 replies
Discussion options

You must be logged in to vote

Okay, interesting. I will need to take a closer look at it then. In the meantime, something like the following might serve as a quick-and-dirty patch:

class SemanticSegmentationSlidingWindowGeoDatasetCustom(SemanticSegmentationSlidingWindowGeoDataset):
	def __getitem__(self, key):
		x, y = super().__getitem__(key)
		y = y.long()
		return x, y

And then use SemanticSegmentationSlidingWindowGeoDatasetCustom in place of SemanticSegmentationSlidingWindowGeoDataset.

The y returned by the dataset should now have the dtype torch.int64.

Replies: 1 comment 12 replies

Comment options

You must be logged in to vote
12 replies
@natedailey7
Comment options

@AdeelH
Comment options

@natedailey7
Comment options

@AdeelH
Comment options

Answer selected by natedailey7
@natedailey7
Comment options

@AdeelH
Comment options

@natedailey7
Comment options

@cpuah
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
3 participants