mirror of
https://github.com/wassname/DeepRL.git
synced 2026-09-09 11:13:47 +08:00
Support python 2.7
This commit is contained in:
@@ -56,7 +56,7 @@ Prediction is sampled after 110K iterations, and I only implemented one-step tra
|
||||
# Dependency
|
||||
* MacOS 10.12 or Ubuntu 16.04
|
||||
* PyTorch v0.4.0
|
||||
* Python 3.5 or 3.6
|
||||
* Python 3.6, 3.5 or 2.7 (deprecated)
|
||||
* Core dependencies: `pip install -r requirements.txt`
|
||||
* Optional: [Roboschool](https://github.com/openai/roboschool), [DeepMind Control Suite](https://github.com/deepmind/dm_control)+[DMControl2Gym](dm_control2gym)
|
||||
|
||||
|
||||
+2
-1
@@ -7,5 +7,6 @@ tensorboardX==1.1
|
||||
scikit-image>=0.13.1
|
||||
tqdm>=4.23.0
|
||||
pandas>=0.22.0
|
||||
pathlib>=1.0.1
|
||||
pathlib2>=1.0.1;python_version <= '2.7'
|
||||
pathlib>=1.0.1;python_version >= '3.5'
|
||||
seaborn>=0.8.1
|
||||
+7
-2
@@ -9,8 +9,13 @@ import pickle
|
||||
import os
|
||||
import datetime
|
||||
import uuid
|
||||
import pathlib
|
||||
import torch
|
||||
try:
|
||||
# python >= 3.5
|
||||
from pathlib import Path
|
||||
except:
|
||||
# python == 2.7
|
||||
from pathlib2 import Path
|
||||
|
||||
def run_episodes(agent):
|
||||
config = agent.config
|
||||
@@ -83,7 +88,7 @@ def sync_grad(target_network, src_network):
|
||||
param._grad = src_param.grad.clone()
|
||||
|
||||
def mkdir(path):
|
||||
pathlib.Path(path).mkdir(parents=True, exist_ok=True)
|
||||
Path(path).mkdir(parents=True, exist_ok=True)
|
||||
|
||||
def set_one_thread():
|
||||
os.environ['OMP_NUM_THREADS'] = '1'
|
||||
|
||||
Reference in New Issue
Block a user