-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathpyraws_install.sh
70 lines (59 loc) · 1.77 KB
/
pyraws_install.sh
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
#!/bin/bash
# This script installs the pyraws package and its dependencies
# Check if Conda is installed
if ! command -v conda &> /dev/null
then
echo "Conda is not installed. Please install Conda and try again."
echo "See https://docs.anaconda.com/anaconda/install/ for more information."
exit 1
fi
# Create a new Conda environment called pyraws
conda create --name pyraws python=3.9 -y
# Activate the environment
source $(conda info --base)/etc/profile.d/conda.sh
if conda activate pyraws; then
echo "pyraws environment activated"
else
echo "pyraws environment not found"
exit 1
fi
# Define PyTorch version and components
pytorch_version="1.11.0"
torchvision_version="0.12.0"
torchaudio_version="0.11.0"
# Function to install PyTorch
install_pytorch() {
conda install -y pytorch==$pytorch_version torchvision==$torchvision_version torchaudio==$torchaudio_version $1 -c pytorch
}
# Install via pip:
# pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cu113
# Detect operating system
case "$OSTYPE" in
"darwin"*)
# macOS
echo "Detected macOS"
install_pytorch "cpuonly"
;;
"linux-gnu"|"linux-gnueabihf")
# Linux
echo "Detected Linux"
# Install PyTorch with CUDA 11.3 support
install_pytorch "cudatoolkit=11.3"
;;
"msys"|"win32")
# Windows
echo "Detected Windows"
# Install PyTorch with CUDA 11.3 support
install_pytorch "cudatoolkit=11.3"
;;
*)
echo "Unsupported operating system"
exit 1
;;
esac
# get absolute path of current working directory
# and setup the sys_cfg.py file
echo "PYRAWS_HOME_PATH = '$(pwd)'" > pyraws/sys_cfg.py
echo "DATA_PATH = '$(pwd)/data'" >> pyraws/sys_cfg.py
# install pyraws
pip install -e .