일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- AIFFEL
- 백신후원
- vscode
- docker attach
- numpy
- aiffel exploration
- HookNet
- cs231n
- logistic regression
- 히비스서커스
- 도커
- IVI
- GIT
- 사회조사분석사2급
- 코크리
- 프로그래머스
- Jupyter notebook
- Multi-Resolution Networks for Semantic Segmentation in Whole Slide Images
- airflow
- 오블완
- CellPin
- Pull Request
- WSSS
- cocre
- ssh
- 기초확률론
- 티스토리챌린지
- Decision Boundary
- docker exec
- docker
Archives
- Today
- Total
목록AttributeError: 'DataParallel' object has no attribute 'predict' (1)
히비스서커스의 블로그
[Pytorch] AttributeError: 'DataParallel' object has no attribute 'predict'
파이썬에서 딥러닝 프레임워크를 pytorch로 쓰다가 GPU 병렬처리를 위해서 DataParallel 처리를 해주었다. import torch # model 생성부분 생략 model = torch.nn.DataParallel(model, device_ids=[0,1,2,3]) # GPU 0,1,2,3 총 4개 사용 model.cuda() 모델을 학습까지 완료시킨 후 다음과 같이 model.predict()을 하니 아래와 같은 에러 메세지가 나왔다. 코드 # x_tensor 생성부분 생략 pr_mask = model.predict(x_tensor) 에러 메시지 AttributeError: 'DataParallel' object has no attribute 'predict' 해결 방안은 다음과 같이 mod..
Programming/Python
2021. 10. 8. 10:55