Have you tried creating a custom environment? Maybe you need to specify explicitly Python 3.10 and configure your training job to use this environment.
You can define an environment in Azure ML using the Python SDK.
https://learn.microsoft.com/en-us/azure/machine-learning/concept-environments?view=azureml-api-2
from azureml.core import Environment
from azureml.core.conda_dependencies import CondaDependencies
# Create a Python environment for AzureML
env = Environment('custom-python3.10-env')
# Build conda dependencies
conda_dep = CondaDependencies()
conda_dep.set_python_version('3.10')
conda_dep.add_conda_package('numpy') # Add other necessary packages
conda_dep.add_pip_package('tensorflow') # Assuming TensorFlow is required
conda_dep.add_pip_package('keras') # Add any additional pip packages
# Add the dependencies to the environment
env.python.conda_dependencies = conda_dep
# Register the environment to reuse later env.register(workspace=your_workspace)
How to use it ?
from azureml.core import Experiment, ScriptRunConfig
# Set up the script run configuration
src = ScriptRunConfig(source_directory='./your_script_folder',
script='train.py', # Your training script
compute_target='your-compute-target', # Your compute target
environment=env) # Use the custom environment
# Submit the experiment
experiment = Experiment(workspace=your_workspace, name='MyExperiment')
run = experiment.submit(config=src)
run.wait_for_completion(show_output=True)