Help Center>
ModelArts>
FAQs>
Training Jobs>
Compiling the Training Code>
How Do I Load Some Well Trained Parameters During Job Training?
Updated on 2022-12-06 GMT+08:00
How Do I Load Some Well Trained Parameters During Job Training?
During job training, some parameters need to be loaded from a pre-trained model to initialize the current model. You can use the following methods to load the parameters:
- View all parameters by using the following code.
from moxing.tensorflow.utils.hyper_param_flags import mox_flags print(mox_flags.get_help())
- Specify the parameters to be restored during model loading. checkpoint_include_patterns is the parameter that needs to be restored, and checkpoint_exclude_patterns is the parameter that does not need to be restored.
checkpoint_include_patterns: Variables names patterns to include when restoring checkpoint. Such as: conv2d/weights. checkpoint_exclude_patterns: Variables names patterns to include when restoring checkpoint. Such as: conv2d/weights.
- Specify a list of parameters to be trained. trainable_include_patterns is a list of parameters that need to be trained, and trainable_exclude_patterns is a list of parameters that do not need to be trained.
--trainable_exclude_patterns: Variables names patterns to exclude for trainable variables. Such as: conv1,conv2. --trainable_include_patterns: Variables names patterns to include for trainable variables. Such as: logits.
Parent topic: Compiling the Training Code
Compiling the Training Code FAQs
- How Do I Create a Training Job When a Dependency Package Is Referenced by the Model to Be Trained?
- What Is the Common File Path for Training Jobs?
- How Do I Install a Library That C++ Depends on?
- How Do I Check Whether a Folder Copy Is Complete During Job Training?
- How Do I Load Some Well Trained Parameters During Job Training?
- How Do I Obtain Training Job Parameters from the Boot File of the Training Job?
- Why Can't I Use os.system ('cd xxx') to Access the Corresponding Folder During Job Training?
- How Do I Invoke a Shell Script in a Training Job to Execute the .sh File?
- How Do I Obtain the Dependency File Path to be Used in Training Code?
- What Is the File Path If a File in the model Directory Is Referenced in a Custom Python Package?
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.
Chatbotmore