天天看點

train.py: error: the following arguments are required: --dataset的解決辦法train.py: error: the following arguments are required: --dataset的解決辦法

train.py: error: the following arguments are required: --dataset的解決辦法

最近在跑别人程式的時候老是遇到這種錯誤:

usage: train.py [-h] --dataset DATASET [--batch_size BATCH_SIZE]
                [--test_batch_size TEST_BATCH_SIZE] [--direction DIRECTION]
                [--input_nc INPUT_NC] [--output_nc OUTPUT_NC] [--ngf NGF]
                [--ndf NDF] [--epoch_count EPOCH_COUNT] [--niter NITER]
                [--niter_decay NITER_DECAY] [--lr LR] [--lr_policy LR_POLICY]
                [--lr_decay_iters LR_DECAY_ITERS] [--beta1 BETA1] [--cuda]
                [--threads THREADS] [--seed SEED] [--lamb LAMB]
train.py: error: the following arguments are required: --dataset
           

解決方法:

進入終端

輸入

python train.py --dataset facades --cuda
           

facades是訓練圖像的檔案

第二種方法

在pycharm中添加參數–dataset facades --cuda即可

這篇文章有更詳細的介紹:https://www.jianshu.com/p/5af851d18a36