You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.4 KiB

#!/usr/bin/env bash
# 외부 GPU 서버 최초 1회 셋업
# 가정: NVIDIA GPU + CUDA 11.8 (다른 CUDA면 paddle wheel URL 수정)
# 실행 위치: ~/workspace/kr_lp_pgnet/
set -euo pipefail
WORKSPACE="${WORKSPACE:-$HOME/workspace}"
PADDLEOCR_DIR="$WORKSPACE/PaddleOCR"
PRETRAIN_DIR="$PADDLEOCR_DIR/pretrain_models"
echo "[1/4] PaddlePaddle GPU 설치 (CUDA 11.8 기준)"
python3 -m pip install --upgrade pip
python3 -m pip install paddlepaddle-gpu==2.6.1.post118 \
-f https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html
echo "[2/4] PaddleOCR clone"
if [ ! -d "$PADDLEOCR_DIR" ]; then
git clone --depth 1 -b release/2.7 https://github.com/PaddlePaddle/PaddleOCR.git "$PADDLEOCR_DIR"
fi
cd "$PADDLEOCR_DIR"
python3 -m pip install -r requirements.txt
echo "[3/4] PGNet Step1 pretrain weight 다운로드"
mkdir -p "$PRETRAIN_DIR"
cd "$PRETRAIN_DIR"
if [ ! -d "train_step1" ]; then
wget -q https://paddleocr.bj.bcebos.com/dygraph_v2.0/pgnet/train_step1.tar
tar xf train_step1.tar
rm train_step1.tar
fi
echo "[4/4] GPU/Paddle 동작 확인"
python3 -c "import paddle; print('paddle:', paddle.__version__); print('CUDA available:', paddle.is_compiled_with_cuda()); print('GPU count:', paddle.device.cuda.device_count())"
echo
echo "셋업 완료. 다음 단계:"
echo " python data_gen/generate_synthetic.py ..."
echo " bash scripts/run_step1.sh"