Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 | 29 | 30 |
| 31 |
Tags
- 코이딥
- Deep learning
- 칼만필터
- 머신러닝
- Battery SOH
- 배터리 AI
- 머신러닝 코드
- tensorflow
- AzureML
- 배터리 모델링
- 리튬배터리
- eis
- Battery modeling
- 배터리 딥러닝
- 코드로 이해하는 딥러닝
- Incremental Capacity Analysis
- 배터리 열화
- Azure
- 딥러닝 코드
- 딥러닝
- state of health
- 배터리 연구
- Battery Deep Learning
- 텐서플로우
- 배터리 진단
- Machine Learning
- Battery Management System
- 배터리 EIS
- Battery AI
- bms
Archives
- Today
- Total
Engineering insight
[Tensor 오류] RuntimeError : expected scalar type Double but found Float 본문
DeepLearning Framework & Coding/De-bugging
[Tensor 오류] RuntimeError : expected scalar type Double but found Float
Free-Nomad 2022. 6. 5. 13:37RuntimeError : expected scalar type Double but found Float
파이토치를 쓰다보면 종종 자주 등장하는 경고문구인데..
Pytorch는 Tensor연산시 Float32를 기준으로 진행하기에
본인이 학습시키고자 하는 데이터의 형식이 double이거나, Float64, int같은 다른 형태일때 발생하는 오류입니다..
DataFrame이나 numpy로 그냥 불러오면 double인 경우도 있는데요
이럴때는 하기와 같이 data type을 Float32로 바꿔주면 정상 연산 됩니다.
ex) tran_gan_window_X라는 데이터의 타입을 변형할시 코드
train_gan_window_X = torch.tensor([train_gan_window_X], dtype = torch.float32)
'DeepLearning Framework & Coding > De-bugging' 카테고리의 다른 글
| [VSCode] The window is not responding 오류 해결 방법 (4) | 2025.06.14 |
|---|---|
| [Colab] 사용 가능한 RAM을 모두 사용한 후 세션이 다운되었습니다. (0) | 2022.06.11 |
| ModuleNotFoundError: No module named 'tensorflow_addons' (0) | 2022.03.04 |
| [python] AttributeError: 'numpy.ndarray' object has no attribute 'numpy' (0) | 2021.12.25 |
| [Github] Google Colab파일 Github로 push하기 (2) | 2021.12.21 |
