The code directory fails to be downloaded during training job running, and the following error message is displayed. See Figure 1.
ERROR: modelarts-downloader.py: Get object key failed: 'Contents'
The code directory specified during training job creation does not exist. As a result, the training fails.
Check whether the code directory specified during training job creation, that is, the OBS bucket path, is correct based on the error cause. There are two methods to check whether it exists.
import moxing as mox mox.file.exists('obs://obs-test/ModelArts/examples/')