A problem occurs during deep learning training and testing: error: the following arguments are required: --dataroot. The main reason for this problem is that there is a problem with the training configuration file and the testing configuration file. See below for specific solutions.
Table of contents
1. Configure training files
Before formal training, you need to configure the training file in the compilation software. The configuration method I provide here is in the Pycharm compilation software. The configuration methods of other compilation software are similar. The specific configuration method is as follows:
(1) Run the train.py file first, and an error message will be reported at this time, prompting that the training file needs to be configured, as follows:
The error message is as follows: error: the following arguments are required: --dataroot
(2) Open the drop-down menu of Run, click Edit Configurations, as follows:
As shown in the figure above, enter the following command in the opened edit box and click OK to add the training configuration file:
2. Start training
After the above steps are ready, enter the following command in the Terminal console and press Enter to start training, as follows:
python train.py --dataroot ./datasets/horse2zebra --name horse2zebra_cyclegan --model cycle_gan
After the carriage return, the situation of the following sample paper shows that it is training normally:
3. Configure test files
Also similar to the above method, configure the test file, first run the following test.py file, and an error message will also be reported, as follows:
Start configuring the test file:
4. Start the test
Enter the following command in the Terminal console and press Enter to start the test, as follows:
python test.py --dataroot datasets/horse2zebra/testA --name horse2zebra_pretrained --model test --no_dropout
When the following sample paper appears, it means that the test is completed, see below:
The above is the method to solve the problem of deep learning training and testing: error: the following arguments are required: --dataroot, that is, the configuration method of the training file and the configuration method of the test file. I hope the method I summarized can help you, thank you !