-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·80 lines (69 loc) · 2.26 KB
/
setup.sh
File metadata and controls
executable file
·80 lines (69 loc) · 2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/bash
# Setup script for Turret vs Drone RL environment
# Creates conda environment with Python and installs packages via pip (faster than conda)
set -e # Exit on error
ENV_NAME="turret_rl"
PYTHON_VERSION="3.10"
echo "=========================================="
echo "Setting up Turret RL Environment"
echo "=========================================="
# Check if conda is available
if ! command -v conda &> /dev/null; then
echo "Error: conda not found. Please install Miniconda or Anaconda first."
exit 1
fi
# Remove existing environment if it exists
if conda env list | grep -q "^${ENV_NAME} "; then
echo "Removing existing '${ENV_NAME}' environment..."
conda env remove -n ${ENV_NAME} -y
fi
# Create new environment with just Python
echo ""
echo "Creating conda environment '${ENV_NAME}' with Python ${PYTHON_VERSION}..."
conda create -n ${ENV_NAME} python=${PYTHON_VERSION} -y
# Activate environment
echo ""
echo "Activating environment..."
source "$(conda info --base)/etc/profile.d/conda.sh"
conda activate ${ENV_NAME}
# Install PyTorch (with CUDA support if available)
echo ""
echo "Installing PyTorch..."
if command -v nvidia-smi &> /dev/null; then
echo "NVIDIA GPU detected - installing PyTorch with CUDA support"
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
else
echo "No NVIDIA GPU detected - installing CPU-only PyTorch"
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
fi
# Install core dependencies
echo ""
echo "Installing core dependencies..."
pip install \
gymnasium==0.29.1 \
stable-baselines3==2.2.1 \
numpy>=1.24.0 \
matplotlib>=3.7.0 \
imageio>=2.31.0 \
imageio-ffmpeg>=0.4.8 \
tqdm>=4.65.0
# Install optional dependencies
echo ""
echo "Installing optional dependencies..."
pip install \
tensorboard>=2.14.0 \
wandb>=0.15.0
echo ""
echo "=========================================="
echo "Setup complete!"
echo "=========================================="
echo ""
echo "To activate the environment, run:"
echo " conda activate ${ENV_NAME}"
echo ""
echo "To run the demo:"
echo " python demo/run_demo.py"
echo ""
echo "To train a new model:"
echo " python -m turret_rl.agents.train_sac --timesteps 1000000"
echo ""