Prepare a session environment

Before running session, you need to set the execution environment of code as below.

  • If you can install with pip

    Write the python library in setup.py or requirements.txt as shown below.

    from distutils.core import setup
    
    setup(
        name='ladder_networks',
        version='1.0',
        install_requires=[
            'matplotlib',
            'tqdm',
            'pillow'
        ]
    )
    
  • If you can not install with pip

    You can set the execution environment by setting the docker environment. You can write the name of the image of the docker by attaching '#nsml:' to the top of setup.py or requirements.txt.

    setup.py

    #nsml: nsml/default_ml:cuda9
    from distutils.core import setup
    
    setup(
        name='ladder_networks',
        version='1.0',
        install_requires=[
            'matplotlib',
            'tqdm',
            'pillow'
        ]
    )
    

    requirements.txt

    #nsml: nsml/default_ml:cuda9
    matplotlib
    tqdm
    pillow
    

    Note

    If you have both setup.py and requirements.txt, install setup.py first and install requirements.txt.

    Note

    If you do not list the docker environment, use nsml/default_ml:latest. (latest version may change. )

  • If you need to install a package with apt-get

    If you create a nsml_package.txt file and specify the required library, it will be installed.

    nsml_package.txt

    wget
    vim
    

    Note

    Installed as apt-get -y update && apt-get -y install [package]. If you need more commands to install it, we recommend that you configure a new docker environment.

NSML ignore

When you run session with nsml run , the files that you do not need will be also uploaded and take a long time. If you list files that is not related to session execution in .nsmlignore such as session .gitignore format, you can prevent unneeded files from uploading.

.nsmlignore

images/
models/
data/