3_image_test.sh 722 Bytes
Newer Older
1
#!/bin/bash
2
TARGET_DIR=gpu-base-image-test
chenpangpang's avatar
chenpangpang committed
3
4
5
6
7
8
# 检查是否提供了输入参数
if [ -z "$1" ]; then
  echo "please set input image"
  exit 1
fi

9
if [[ "$1" == *"pytorch"* ]]; then 
chenpangpang's avatar
chenpangpang committed
10
11
  docker run --rm --platform=linux/amd64 --gpus all -v ./$TARGET_DIR:/workspace --workdir /workspace/pytorch/stable-diffusion-v1-4 $1 python infer.py; fi

12
if [[ "$1" == *"tensorflow"* ]]; then 
chenpangpang's avatar
chenpangpang committed
13
  docker run --rm --platform=linux/amd64 --gpus all -v ./$TARGET_DIR:/workspace --workdir /workspace/tensorflow/mnist $1 python train.py; fi
chenpangpang's avatar
chenpangpang committed
14

15
16
if [[ "$1" == *"paddle"* ]]; then 
  TARGET_DIR=gpu-base-image-test/paddletest 
chenpangpang's avatar
chenpangpang committed
17
18
  docker run --rm --platform=linux/amd64 --gpus all -v ./$TARGET_DIR:/workspace --workdir /workspace $1 python image.py; fi