티스토리 뷰
Tech/Troubleshooting
AttributeError: module 'tensorflow' has no attribute 'set_random_seed'
Ellie Kim 2020. 4. 16. 14:00seed = 0
numpy.random.seed(seed)
tf.set_random_seed(seed)
seed값을 생성해 주는데 AttributeError: module 'tensorflow' has no attribute 'set_random_seed' 에러가 발생했다.
문서를 확인해보니 변경되었다.
tf.set_random_seed(seed)
대신 아래와 동일하게 사용해주면 된다.
tf.random.set_seed(seed)
https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/random/set_seed
tf.random.set_seed | TensorFlow Core r2.0
Sets the graph-level random seed. Aliases: tf.compat.v2.random.set_seed tf.random.set_seed(seed) Used in the tutorials: Operations that rely on a random seed actually derive it from two seeds: the graph-level and operation-level seeds. This sets the graph-
www.tensorflow.org
'Tech > Troubleshooting' 카테고리의 다른 글
| 나만 몰랐던 스위프트 willSet, didSet의 이야기 (0) | 2020.06.18 |
|---|---|
| Command PhaseScriptExecution failed with a nonzero exit code (1) | 2020.04.26 |
| Verify developer APP certificate문제 (0) | 2020.04.10 |
| 이미지뷰에 Tap Gesture Recognizer가 인식되지 않는 현상 (0) | 2020.04.06 |
| 깃 한글 파일명 포함 해결 (0) | 2020.03.24 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- foundationmodels
- ARC
- wwdc
- iOS SwiftUI
- RX
- 문자열
- ReactiveX
- 애니메이션
- objective-c
- ios
- Deep learning
- 책
- leetcode
- Algorithm
- 독서
- 책 후기
- Xcode
- 스위프트
- objc
- 머신러닝
- swift5
- 스위프트UI
- 딥러닝
- rxswift
- string
- swiftUI
- 알고리즘
- SWIFT
- Animation
- 책 추천
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
글 보관함