执行.sh文件

有些代码项目给.sh文件。

例如

GitHub - renqianluo/NAO_pytorch: Pytorch Implementation of Neural Architecture Optimization

文件名 train_NAONet_A_36_cifar10.sh

# Train the architecture discovered by NAO, with channel size of 36, noted as NAONet-A-36
nvidia-smi
MODEL=NAONet_A_36_cifar10
OUTPUT_DIR=exp/$MODEL
DATA_DIR=data

mkdir -p $OUTPUT_DIR

fixed_arc="0 7 1 15 2 8 1 7 0 6 1 7 0 8 4 7 1 5 0 7 0 7 1 13 0 6 0 14 0 9 1 10 0 14 2 6 1 11 0 7"

python train_cifar.py \
  --data=$DATA_DIR \
  --output_dir=$OUTPUT_DIR \
  --arch="$fixed_arc" \
  --use_aux_head \
  --cutout_size=16 | tee -a $OUTPUT_DIR/train.log

四种执行方法

方式一: (要进到shell脚本所在文件夹中)

bash train_NAONet_A_36_cifar10.sh

方式二: (要进到shell脚本所在文件夹中)

sh train_NAONet_A_36_cifar10.sh

方式三: (要进到shell脚本所在文件夹中)

./train_NAONet_A_36_cifar10.sh

第三种方式可能会出现

-bash: ./train_NAONet_A_36_cifar10.sh: Permission denied

 解决方式:

chmod +x train_NAONet_A_36_cifar10.sh

方式四: 

/root/autodl-tmp/NAO_pytorch-master/NAO_V1/train_NAONet_A_36_cifar10.sh

运行结果展示

Sun Oct  6 14:39:01 2024
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.90.07              Driver Version: 550.90.07      CUDA Version: 12.4     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 2080 Ti     On  |   00000000:3D:00.0 Off |                  N/A |
| 28%   31C    P8              8W /  250W |       1MiB /  11264MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
|   1  NVIDIA GeForce RTX 2080 Ti     On  |   00000000:40:00.0 Off |                  N/A |
| 26%   29C    P8             20W /  250W |       1MiB /  11264MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |
+-----------------------------------------------------------------------------------------+
10/06 02:39:01 PM Args = Namespace(arch='0 7 1 15 2 8 1 7 0 6 1 7 0 8 4 7 1 5 0 7 0 7 1 13 0 6 0 14 0 9 1 10 0 14 2 6 1 11 0 7', batch_size=128, channels=36, cutout_size=16, data='dataset', dataset='cifar10', drop_path_keep_prob=0.8, epochs=600, eval_batch_size=500, grad_bound=5.0, keep_prob=0.6, l2_reg=0.0003, layers=6, lr_max=0.025, lr_min=0, mode='data/cifar-10/', nodes=5, output_dir='exp/NAONet_A_36_cifar10', seed=0, steps=234600, use_aux_head=True)
Files already downloaded and verified
Files already downloaded and verified
10/06 02:39:03 PM param size = 11.470150MB
10/06 02:39:03 PM Use 2 GPUs !

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

lebrongao

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值