정리/잡 에러들
[Pytorch 에러] RuntimeError: one_hot is only applicable to index tensor.
yun_s
2023. 3. 4. 10:29
728x90
반응형
에러
RuntimeError: one_hot is only applicable to index tensor.
F.one_hot 함수를 사용하다 에러가 났다.
해결 방법
one_hot = F.one_hot(vector.to(torch.int64))
dtype을 int로 바꿔주면 된다.
728x90
반응형