code(3)
-
random seed 고정 시키기
pytorch seed 고정 random_seed = 530 torch.manual_seed(random_seed) torch.cuda.manual_seed(random_seed) torch.cuda.manual_seed_all(random_seed) # if use multi-GPU torch.backends.cudnn.deterministic = True torch.backends.cudnn.benchmark = False np.random.seed(random_seed) random.seed(random_seed) tensorflow seed 고정 SEED = 50 os.environ['PYTHONHASHSEED'] = str(SEED) os.environ['TF_DETERMINISTIC_OPS']..
2021.07.22 -
error 해결
vscode에서 복사 붙여넣기 하면 ctrl+/이 안먹히고 글이 안지워지는 현상이 있었는데 찾아보니 이게 한컴입력기로 되어있어서 그랬다. Microsoft입력기로 바꿔주면 해결! [konlpy 오류] module 'tweepy' has no attribute 'StreamListener' → /가상환경 경로/lib64/python3.6/site-packages/konlpy/stream/twitter.py 들어가서 class CorpusListener(tweepy.StreamListener): -> class CorpusListener(tweepy.Stream):으로 변경해준다.
2021.06.16 -
code 기록
실행할 때마다 같은 결과를 출력하기 위해 설정 #필요한 라이브러리 불러오기 import numpy as np import tensorflow as tf np.random.seed(3) tf.random.set_seed(3)
2021.05.29