일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- GIT
- Jupyter notebook
- 프로그래머스
- docker attach
- 히비스서커스
- 코크리
- 오블완
- WSSS
- ssh
- logistic regression
- docker exec
- CellPin
- Pull Request
- airflow
- cocre
- 도커
- Decision Boundary
- HookNet
- 백신후원
- Multi-Resolution Networks for Semantic Segmentation in Whole Slide Images
- vscode
- docker
- IVI
- 티스토리챌린지
- 기초확률론
- AIFFEL
- 사회조사분석사2급
- cs231n
- aiffel exploration
- numpy
Archives
- Today
- Total
목록RuntimeError: only batches of spatial targets supported (3D tensors) but got targets of size (1)
히비스서커스의 블로그
[Pytorch] RuntimeError: only batches of spatial targets supported (3D tensors) but got targets of size
상황 torch로 segmentation model을 돌리는 상황에서 발생하였다. 대략적인 코드 # import unet from seg_model.py from seg_model import unet import torch # output 3 classes model = unet(class=3) # loss 4 classes weights = torch.tensor([1.2, 2.6, 7.5, 17.0], dtype=torch.float32) loss = torch.nn.CrossEntropyLoss(weight=weights) 에러메시지 RuntimeError: only batches of spatial targets supported (3D tensors) but got targets of size..
Programming/Python
2021. 12. 31. 17:49