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
- Anaconda
- 기사 실기
- DEEPLEARNING
- 파이썬
- 자격증
- Apple
- 실기시험
- 큐넷
- Logitech
- 파이토치
- 코딩
- 로지텍
- torch
- 우분투
- 정보처리기사 실기
- ubuntu
- 실기
- 정보처리
- keyboards
- 국가자격증
- pytorch
- 정보처리기사
- coding
- Python
- 기사시험
- python3
- NCS
- 딥러닝
- 2020정보처리기사
- qnet
Archives
- Today
- Total
dhwiii's notepad | 딥 러닝, 코덱 일기장
[Numpy 에러] TypeError: only size-1 arrays can be converted to Python scalars 본문
■ Working Draft/◎ 에러코드 일기장
[Numpy 에러] TypeError: only size-1 arrays can be converted to Python scalars
dhwiii 2021. 5. 19. 18:58TypeError: only size-1 arrays can be converted to Python scalars
일반적으로 사용하는 math 함수와 numpy array의 형태를 가진 변수와 호환이 잘 되지 않아서 에러가 발생한 것 같다.
mse = tf.reduce_mean((float)((fake_hr - imgs_hr) ** 2))
#변경 전
PSNR = 10 * math.log10((255 ** 2) / mse)
#변경 후
PSNR = 10 * np.math.log10((255 ** 2) / mse)
np.math를 사용해 보도록 하자
'■ Working Draft > ◎ 에러코드 일기장' 카테고리의 다른 글
Comments