Skip to content

liuzhaoze/Tianshou-CartPole

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Tianshou-CartPole

A demo using Tianshou to solve the Cart Pole task.

Python Environment Setup

Create a new conda environment:

# Create a new conda environment
conda create -n tianshou python=3.11

# Activate the environment
conda activate tianshou

Install Tianshou:

git clone --branch v1.1.0 --depth 1 https://github.com/thu-ml/tianshou.git
cd tianshou
pip install poetry

# Change the source of poetry if necessary
poetry source add --priority=primary tsinghua https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple

poetry lock --no-update
poetry install

Install cart-pole game:

pip install 'gymnasium[classic-control]==0.28.1'

Install TensorBoard and WandB for logging:

pip install tensorboard
pip install wandb

Usage

python tianshou-cartpole.py --watch --watch-episode-num 3

TODO

  • tianshou-cartpole.py:
    • add save_checkpoint_fn and resume training

About

A demo using Tianshou to solve the Cart Pole task.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages