본문 바로가기

분류 전체보기

(290)
[pytorch] type casting 하기, 타입 변환하기 가끔 가다가 RuntimeError: expected scalar type Float but found Double 이런 에러가 발생한다. 그럴경우... a 라는 텐서가 있으면 아래와 같이 케스팅해주면 된다. type도 변환된 자기 자신을 리턴한다. a = a.type(torch.FloatTensor).to(device)
[논문 읽기] Exploring the structure of a real-time, arbitrary neuralartistic stylization network - 2 - 네트워크가 명시적으로 훈련받은 스타일에만 작용한다. - 한 번도 보지못한, 혹은 많은 스타일에 대해서도 성능을 갖는 것이 목표. 이 방법의 장점 : 테스트 타임에 처음 보는 이미지에 대해 적절한 스타일을 예측할 수 있다! PCA를 한뒤, 중심 축을 평균, 각각 +- 2표준 편차씩 움직여서 변화를 봤다. style 이미지와 linear ineterpolation도 가능한 듯하다. github.com/magenta/magenta/tree/master/magenta/models/arbitrary_image_stylization magenta/magenta Magenta: Music and Art Generation with Machine Intelligence - magenta/magenta github...
[논문 읽기] Exploring the structure of a real-time, arbitrary neuralartistic stylization network 1 이전 논문은 이미지 하나당 optimization을 해야했다면 이 논문은 이런 점을 보완했다. (2015) A Neural Algorithm of Artistic Style 각각의 loss가 있다. style 이미지가 주어지면 style 예측 네트워크 P에서 S를 추출한다. 이게 style tranfer 네트워크 T에 콘텐츠 이미지 (입력이미지) 입력된다. 콘텐츠 이미지와 S가 T에 더해져 스타일이 입혀진 이미지가 생성된다. - Style loss 스타일이 입혀진 이미지 VS 스타일 이미지 - Content loss 스타일이 입혀진 이미지 VS 콘텐츠 이미지 각각 거리를 최소화하는 방식으로 작동하기에, 콘텐츠의 내용을 잃지 않으면서 스타일을 학습할 수 있는 것이다. 두 이미지 Content가 유사하다 :..
[selenium] python, 구글 이미지 크롤링하기 (원본화질, 고화질) 전체코드 from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By from selenium.common.exceptions import TimeoutException from selenium import webdriver from selenium.webdriver.common.keys import Keys import os options = webdriver.ChromeOptions() options.add_argument('headless') options.add_ar..
Pandas error, csv를 읽고 쓸 때 발생하는 유니코드 에러 오류 Pandas에서 csv를 읽고 쓸때 발생하는 에러 UnicodeEncodeError: 'ascii' codec can't encode characters ... print(data.head())라고하면 출력이 안된다. 무슨 문제일까... 작동하지 않는 해결법들 1. 저장할 때 애초에 encoding='utf-8-sig'으로 저장하기. 시도했으나 안됨 df.to_csv('blarblar.csv', encoding='utf-8-sig') stackoverflow.com/questions/44630798/pandas-ascii-codec-cant-encode-character-in-position-ordinal-not-in-range-whi Pandas: ascii codec cant encode cha..
DevToolsActivePort file doesn't exist error 해결법 크롤링 에러 간단하게 해결하는 방법. 에러 WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally. (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) 해결법 크롬 옵션 추가 ( headless, no-sandbox 필수) from selenium import webdriver chrome_options = web..
[논문 읽기] SeFa - Closed-Form Factorization of Latent Semantics in GANs 핵심 코드 분석 transformation matrix A에 대해 조사해야한다. 왜냐면 An의 최댓값을 이미지 Edit을 최대화 시킬 수 있기 때문이다. 그래서 A^TA의 고유벡터와 고유값을 찾는다. gan_type = parse_gan_type(net.decoder) layers, boundaries, values = factorize_weight(net.decoder, args.layer_idx) generator의 weight와 layer 인덱스를 인자로 받고, 그 결과로 layers, boundarys, values를 내 뱉는다. 문맥상 layers는 이미지 Edit에 관여된 layer들을 의미하고, boundarys가 고유 벡터, values가 고유값을 의미하는 듯하다. 위 값들은 실제 코드에 어떻게 쓰일까? ..
[ubuntu 20.04] nvidia-smi 안되는 문제. 뜻밖의 해결 방법 에러 증상 nvidia-smi 치면 failed to initialize nvml: driver/library version mismatch nvcc -V 는 정상 작동 이외에도 pytorch 실행시 extension error 발생 File "/home/gerald/miniconda3/envs/maskrcnn_benchmark/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1413, in _run_ninja_build raise RuntimeError(message) RuntimeError: Error compiling objects for extension pytorch gcc compile runtime error compute 7..

728x90