본문 바로가기

반응형

Data-science/deep learning

(87)
keras Data generator custom하게 만들기 많은 데이터를 한 번에 Test하려고 하면 RAM error가 뜸. 이때 어떻게 하냐? Data generator를 이용하면 된다. 방법은 생각보다 간단하다. Sequence라는 녀석을 상속받는 클래스를 만들고, init과 __len__, __getitem__을 작성해준다! 필자의 경우 files가 입력으로 들어오면, 거기서 image를 로드하면 되는 형태다. 또한 file을 열면 그 파일 내에 X, Y가 둘다 들어가 있다. __getitem__을 구현해주면 된다. index 부분은 건드리지 않고 나머지 부분을 본인의 로직에 맞게 수정하면 된다. from tensorflow.keras.preprocessing import image from tensorflow.keras.utils import Seque..
conda install vs pip install 가상환경 구축시 tensorflow 같은 lib들은 cuda, cudnn 등 dependency가 많이 걸려있다. conda install을 통해 설치하면 이런 dependency를 한꺼번에 해결 가능하다. pip install로 하면, 많은 삽질이 필요. conda install을 추천한다. conda install -c anaconda tensorflow-gpu=1.14.0
stylegan2 환경 구축 requirements에는 cuda 10.0으로 나와있는데 cuda 10.1로 해야 된다. 정상 동작 확인 pytorch repo github.com/rosinality/stylegan2-pytorch rosinality/stylegan2-pytorch Implementation of Analyzing and Improving the Image Quality of StyleGAN (StyleGAN 2) in PyTorch - rosinality/stylegan2-pytorch github.com tensorflow 공식 버전보다 훨씬 좋다고 느껴짐...
tensorflow 설치시 주의점 conda install vs pip install gpu를 사용할 경우 1.15 버전까지?는 -gpu를 명시해줘야 함 conda install tensorflow-gpu==1.15 로 하면 그냥 tensorlfow로 설치돼서 충돌이 일어난 것을 확인 가상환경을 새로 만들고 아래를 실행하니 됨 pip install tensorflow-gpu==1.15
gcc version, g++ version downgrade (8 to 7, on linux) gist.github.com/jlblancoc/99521194aba975286c80f93e47966dc5 Installing gcc-7 & g++-7 in Ubuntu 16.04LTS Xenial Installing gcc-7 & g++-7 in Ubuntu 16.04LTS Xenial - Install_gcc7_ubuntu_16.04.md gist.github.com sudo apt-get install -y software-properties-common sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt update sudo apt install g++-7 -y sudo update-alternatives --install /usr/bin/g..
tensorflow 설치시 cuda, cudnn 버전 호환성 www.tensorflow.org/install/source#tested_build_configurations 소스에서 빌드 | TensorFlow 소스에서 TensorFlow pip 패키지를 빌드하고 Ubuntu Linux 및 macOS에 설치합니다. 명령어는 다른 시스템에도 적용될 수 있지만, Ubuntu 및 macOS용으로만 테스트되었으며 지원됩니다. 참고: 잘 테스트되고 www.tensorflow.org
conda 가상환경 구축 가상환경 리스트 보기 conda env list 가상환경 만들기 conda create -n [가상환경이름] python=3.7 가상환경 활성화 conda activate 가상환경이름
trajactory GRU 코드 trajGRU 코드 논문 원제 : Deep Learning for Precipitation Nowcasting: A Benchmark and A New Model ConvLSTM-based models is location-invariant while natural motion and transformation (e.g., rotation) are location-variant in general. Specifically, we go beyond ConvLSTM and propose the Trajectory GRU (TrajGRU) model that can actively learn the location-variant structure for recurrent connections. https://..

728x90
반응형