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 |
Tags
- 정보처리기사 실기
- 정보처리
- 코딩
- keyboards
- 국가자격증
- 우분투
- ubuntu
- pytorch
- qnet
- 파이썬
- 자격증
- 2020정보처리기사
- Python
- 큐넷
- python3
- Logitech
- 파이토치
- 딥러닝
- Apple
- 정보처리기사
- coding
- NCS
- Anaconda
- DEEPLEARNING
- 로지텍
- 실기시험
- 기사시험
- torch
- 기사 실기
- 실기
Archives
- Today
- Total
dhwiii's notepad | 딥 러닝, 코덱 일기장
[파이썬 에러코드] IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number 본문
■ Working Draft/◎ 에러코드 일기장
[파이썬 에러코드] IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number
dhwiii 2021. 4. 14. 22:03파이썬 파이토치 에러입니다.
IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number
파이썬 파이토치의 버전이 0.5 이전 버전을 사용하게 되면 해당 에러가 나타나게 되는데,
[변경 전] generator_adversarial_loss.data[0] -> [변경 후] generator_adversarial_loss
이런 식으로 제일 뒤에 있는 [0]을 지워주시면 해결 됩니다.
'■ Working Draft > ◎ 에러코드 일기장' 카테고리의 다른 글
[파이썬 에러코드] TypeError: 'module' object is not callable (0) | 2021.05.06 |
---|---|
[Mac 에러코드] M1 맥 터미널에서 command not found 뜰 때 (0) | 2021.05.03 |
[파이썬 에러코드] TypeError: can only concatenate str (not "Tensor") to str (0) | 2021.05.03 |
[파이썬 에러코드] ModuleNotFoundError: No module named '~~ ' (0) | 2021.04.29 |
[파이썬 에러코드] BrokenPipeError: [Errno 32] Broken pipe (0) | 2021.04.14 |
Comments