Deze pagina is nog niet beschikbaar in uw eigen taal. We werken er hard aan om meer taalversies toe te voegen. Bedankt voor uw steun.

On this page

Show all

Help Center/ ModelArts/ FAQs/ Training Jobs/ Compiling the Training Code/ What Is the File Path If a File in the model Directory Is Referenced in a Custom Python Package?

What Is the File Path If a File in the model Directory Is Referenced in a Custom Python Package?

Updated on 2024-06-11 GMT+08:00

To obtain the actual path to a file in a container, use Python.

os.getcwd() # Obtain the current work directory (absolute path) of the file.
os.path.realpath(__ file __) # Obtain the absolute path of the file.

You can also use other methods of obtaining a file path through the search engine and use the obtained path to read and write the file.

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback