728x90

AI | ML 43

[RL] Windows 환경에서 Ray 설치 및 실행하기

일단 전제로 알아두어야 할 것이 Windows 환경에서는 지원이 완벽하지 않다고 한다. 1. 기본적인 설치 명령어를 입력한다. pip install -U ray 2. 아래 링크로 들어가 C++ runtime 파일을 설치하고 재실행한다. 2번을 제대로 실행하지 않을 경우, ray.init() 이라는 명령어를 실행했을 때 30초 이내에 응답이 없다는 에러가 발생한다. (The current node has not been updated within 30 seconds. error) https://docs.ray.io/en/master/installation.html#windows-support Installing Ray — Ray v2.0.0.dev0 .rst .pdf to have style consist..

[CVPR 2021] Reinforced Attention For Few Shot Learning And Beyond Shot_Learning_and_Beyond 리뷰

논문 : https://openaccess.thecvf.com/content/CVPR2021/papers/Hong_Reinforced_Attention_for_Few-Shot_Learning_and_Beyond_CVPR_2021_paper.pdf Abstract Policy Gradient 알고리즘을 이용한 RL 기반의 attention agent로 Backbone 네트워크 제안 학습된 적 없는 데이터에도 학습이 가능한 범용적인 reward function 설계 Introduction 딥러닝 알고리즘이 데이터에 의존적임에 따라 라벨링의 중요성이 언급되지만, 데이터가 클수록 준비해야하는 양도 많다보니 제약이 많다 → few-shot learning 연구의 시작점 언급 few-shot learning 접근법..

[Pytorch Lightning] Pytorch-Lightning 사용해보기

최근에 PyTorch-lightning이라는 라이브러리를 알게 되었다. Pytorch-lightning(PL)은 이름만 들어도, pytorch를 경량화시킨거 같다는 생각이 들었는데, PL이 pytorch와 다른점이 무엇인지 알아보았다. 대략적인 설명은 홈페이지에서 볼 수 있다. https://www.pytorchlightning.ai/ PyTorch Lightning The ultimate PyTorch research framework. Scale your models, without the boilerplate. www.pytorchlightning.ai 나의 느낀점은 Pytorch는 Python스러운 Numpy를 DL에 접목시킨 확장시킨 라이브러리였다면, Pytorch Lightning은 "학습"의..

[RL] stable-baselines3 모델 학습, 불러오기

아래의 코드는 기존의 gym library를 이용한 경우지만, custom Env의 경우는 이전 글을 참조하면 된다. https://tw0226.tistory.com/80 import gym from stable_baselines3 import DQN from stable_baselines3.common.evaluation import evaluate_policy # Create environment env = gym.make('LunarLander-v2') # Instantiate the agent model = DQN('MlpPolicy', env, verbose=1) # Train the agent model.learn(total_timesteps=int(2e5)) # Save the agent m..

[RL] 강화학습 모델 라이브러리 stable-baselines3 사용해보기

링크 : https://github.com/DLR-RM/stable-baselines3 DLR-RM/stable-baselines3 PyTorch version of Stable Baselines, reliable implementations of reinforcement learning algorithms. - DLR-RM/stable-baselines3 github.com 소개 강화학습을 학습시키려고 하면 모델들마다 사용법이 각각 달라서 많은 에러를 겪곤 한다. 하지만, stable-baselines3 라이브러리를 이용하면 아래의 장점이 생긴다. 1. 다양하게 구현된 모델들을 사용할 수 있고, 2. 경우에 따라 multi-processing 까지 지원된다. 일일이 모델마다 구현할 필요가 없어진다는 의..

[CUDA] 윈도우 환경에서 CUDA 버전 변경

어떤 github의 딥러닝 코드는 tensorflow 1.14 버전을 썼는데, 1.14 버전은 CUDA 11버전이 호환되지 않아서 1. python 버전 변경 2. tensorflow 재설치 3. CUDA 버전 번경 (11 -> 10) 의 절차가 필요하였다. 나의 상황은 다음과 같고, 하나씩 적용해봤다. GPU : 2060 RTX OS : Windows 10 CUDA : 11.0 Python : 3.8 1. Python 버전 변경 다행히도 Anaconda를 쓰고 있어서, conda 환경으로 3.6 을 새로 만들어서 쉽게 해결하였다. 2. tensorflow 재설치 마찬가지로, conda 환경으로 새로 설치하고 나니 pip install tensorflow-gpu==1.14.0 으로 쉽게 해결하였다. 3...

[PyTorch] RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation 에러

에러명은 아래와 같았다. RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.FloatTensor [64, 4]], which is output 0 of SoftmaxBackward, is at version 64; expected version 0 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True). 원인을 자세히 보면, inplace opera..

AI | ML/코드 2021.06.28

[gym] NotImplementedError 에러 해결방법

더보기 File "C:\Users\tw\anaconda3\lib\site-packages\gym\core.py", line 264, in reset observation = self.env.reset(**kwargs) File "C:\Users\tw\anaconda3\lib\site-packages\gym\core.py", line 265, in reset return self.observation(observation) File "C:\Users\tw\anaconda3\lib\site-packages\gym\core.py", line 272, in observation raise NotImplementedError NotImplementedError 에러원인 : gym 버전이 맞지 않아서 생기는 오류 ..

728x90