본문 바로가기
728x90
반응형
SMALL

Python11

1. 자료형 1. 수 자료형 데이터는 모두 수(Number)로 표현할 수 있다. e 다음에 오는 수는 10의 지수부를 의미한다. ex) 1e9 -> 1 x 10^9 컴퓨터 시스템은 수 데이터를 처리할 때 2진수를 이용하며, 실수형을 저자하기 위해 4바이트 또는 8바이트라는 고정된 크기의 메모리를 할당하기 때문에 컴퓨터 시스템은 대체로 실수 정보를 표현하는 정확도에 한계가 있다. 실수를 정확히 표현하기 위해서 반올림 함수인 round(argument, 반올림위치-1)를 사용한다. (/) 연산자는 나눠진 결과를 기본적으로 실수형으로 처리한다. 나머지 연산자(%), 몫 연산자(//), 거듭제곱연산자(**) 2. 리스트 자료형 리스트 자료형은 배열을 채택한다. 인덱스값을 입력하여 리스트의 특정한 원소에 접근하는 것을 인덱싱.. 2023. 12. 7.
ModuleNotFoundError: No module named 'skimage' [Error] ModuleNotFoundError: No module named 'skimage' [Solution] pip install scikit-image 2023. 7. 20.
Numpy의 clip 함수 * numpy.clip(Array, Min, Max) Array - 다루려는 array Min - Min값보다 작은 값은 MIn으로 변경 Max - Max값보다 큰 값은 Max으로 변경 2023. 7. 4.
numpy array 전체 출력 [Solution] np.set_printoptions(threshold=np.inf, linewidth=np.inf) 윗 문장 추가해주면 numpy array 전체 출력 가능 2023. 7. 3.
raise ProcessExitedException( torch.multiprocessing.spawn.ProcessExitedException: process 0 terminated with signal SIGSEGV [Error] raise ProcessExitedException( torch.multiprocessing.spawn.ProcessExitedException: process 0 terminated with signal SIGSEGV [Solution] test : python -c 'from fairseq import libnat; print(libnat.suggested_ed2_path([[1, 2, 3, 4]], [[1, 3, 4, 5, 6]], 0))' 에러가 나면, git clone https://github.com/pytorch/fairseq.git && cd fairseq conda install gcc_linux-64 gxx_linux-64 pip install cython python s.. 2023. 6. 28.
ModuleNotFoundError: No module named 'sacrebleu' [Error] ModuleNotFoundError: No module named 'sacrebleu' [Solution] pip install sacrebleu 2023. 6. 28.
ModuleNotFoundError: No module named 'sklearn' [Error] ModuleNotFoundError: No module named 'sklearn' [Solution] conda install scikit-learn or pip install scikit-learn 2023. 6. 28.
nvrtc: error: invalid value for --gpu-architecture (-arch) [error] nvrtc: error: invalid value for --gpu-architecture (-arch) [solution] 1. detectron2/detectron2/engine/train_loop.py line 491 : 주석처리 #with autocast(dtype=self.precision): 2. detectron2/detectron2/engine/train_loop.py line 435~ : False를 True로 변경 class AMPTrainer(SimpleTrainer): def __init__( ... ... zero_grad_before_foward = True ): 2023. 6. 27.
[pytorch] AttributeError: module 'distutils' has no attribute 'version' [Solution] pip install setuptools==59.5.0 2023. 6. 26.
728x90
반응형
LIST