How to exclude selected files from being sent to Neptune?

Problem

When I run my code, entire working directory is sent to the cloud. How to prevent Neptune from sending some files?

Solution

By default, when running

1
neptune run model_training.py

OR

1
neptune send --worker l-2p100 --environment pytorch-0.3.1-gpu model_training.py

the entire folder in which model_training.py resides, is sent to the cloud for further browsing and comparing purposes. You can always choose to exclude some or all files from being send by using the exclude option.

exclude can either be used in the neptune.yaml:

1
2
3
4
5
6
7
exclude:
- secret_file.py
- .git
- .ipynb_checkpoints
- output
- neptune.log
- offline_job.log

or in the command line:

1
2
3
4
5
6
7
8
9
neptune run \
--exclude secret_file.py \
--exclude .git \
--exclude .idea \
--exclude .ipynb_checkpoints \
--exclude output \
--exclude neptune.log \
--exclude offline_job.log \
model_training.py

You can also choose not to send anything at all.

IN the configuration file

1
2
exclude:
- [*]

or via command line

1
neptune run --exclude [*] model_training.py

See also