반응형 전체 글255 텐서플로우 set_random_seed 함수 에러, AttributeError: module 'tensorflow' has no attribute 'set_random_seed' 해결 방법 --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) in () 27 np.random.seed(RANDOM_SEED) 28 rn.seed(RANDOM_SEED) ---> 29 tf.set_random_seed(RANDOM_SEED) AttributeError: module 'tensorflow' has no attribute 'set_random_seed' 해당 오류는 tensorflow 버전에 따라 지원하는 함수 명이 달라 발생하는 문제로, 'tf.set_random.set_seed(RANDOM_SEED)'으로 변경하여 해결할 수 있.. 2024. 3. 28. [Python] docker로 flask 서버 열 때, Connection reset by peer 오류 해결 방법 보호되어 있는 글 입니다. 2024. 3. 14. [Python] boto3 환경 설정, AWS CLI 설치하기 Boto3는 Python용 AWS SDK를 뜻하며, 파이썬으로 AWS를 이리저리 주무를 수 있는 짱짱 라이브러리이다. Boto3 사용을 위해서는 Python 3.8 이상의 버전이 설치되어 있어야 한다. 파이썬 설치링크: https://www.python.org/downloads/ 아래 명령어를 통해 Boto3 를 설치할 수 있다. pip install boto3 Boto3를 본격적으로 사용함에 앞서, AWS CLI를 통해 AWS 계정에 대한 인증 자격 증명을 설정해야 한다. 윈도우 AWS CLI 설치 링크: https://aws.amazon.com/ko/cli/ 64비트 버튼을 눌러 윈도우용 AWS CLI 설치파일을 다운로드 받고, 실행시켜 next를 주구장창 누르다보면 설치가 완료된다. 이제 파워쉘이나.. 2024. 1. 16. plt.savefig 함수에서의 must be real number, not str 오류 발생 아래 캐글 코드를 돌려보다가, 그래프 사진을 저장하는 코드에서 'must be real number, not str'라는 오류가 발생하였다. # https://www.kaggle.com/code/shivamb/semi-supervised-classification-using-autoencoders/notebook def tsne_plot(x1, y1, name="graph.png"): tsne = TSNE(n_components=2, random_state=0) X_t = tsne.fit_transform(x1) plt.figure(figsize=(12, 8)) plt.scatter(X_t[np.where(y1 == 0), 0], X_t[np.where(y1 == 0), 1], marker='o', co.. 2024. 1. 9. 이전 1 2 3 4 5 6 7 8 ··· 64 다음 반응형