Help Center/
ModelArts/
Troubleshooting/
Training Jobs/
In-Cloud Migration Adaptation Issues/
ModelArts Training Job Failed to Parse Parameters and an Error Is Displayed in the Log
Updated on 2024-04-11 GMT+08:00
ModelArts Training Job Failed to Parse Parameters and an Error Is Displayed in the Log
Symptom
The ModelArts training job failed to parse parameters, and the following error occurs:
error: unrecognized arguments: --data_url=xxx://xxx/xxx error: unrecognized arguments: --init_method=tcp://job
absl.flags._exceptions.UnrecognizedFlagError:Unknown command line flag 'task_index'
Possible Cause
- The parameters are not defined.
- In the training environment, the system may input parameters that are not defined in the Python script. As a result, the parameters cannot be parsed, and an error is displayed in the log.
Solution
- Define the parameters. The following is a code sample for reference:
parser.add_argument('--init_method', default='tcp://xxx',help="init-method")
- Replace args = parser.parse_args() with args, unparsed = parser.parse_known_args(). The following is a code sample:
import argparse parser = argparse.ArgumentParser() parser.add_argument('--data_url', type=str, default=None, help='obs path of dataset') args, unparsed = parser.parse_known_args()
Parent topic: In-Cloud Migration Adaptation Issues
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot