Skip to content

symlink not accepted as logger folder  #6690

@jowagner

Description

@jowagner

🐛 Bug

Moving lightning_logs to another filesystem and symlinking it so I don't need to touch my code, I notice that the logger rejects symlinked logger folders:

loggers/csv_logs.py if not os.path.isdir(root_dir):

Users will expect symlinks to folders to work the same way as folders.

To Reproduce

mkdir /tmp/lightning_logs
ln -s /tmp/lightning_logs/

and try training as usual.

Expected behavior

The symlinked folder is accepted and, in the above example, the logs start filling /tmp instead of $HOME.

Workarounds

(Breaking existing paths)

Solution 1: Create a folder inside the symlinked folder and set save_dir to this subfolder (not tested)
Solution 2: Use the absolute path to the folder, e.g. trainer = pl.Trainer(logger = pl.loggers.TensorBoardLogger(os.path.abspath('lightning_logs'))) (I was expecting the next run to go to version_3 after I had versions 0, 1 and 2 but it went to default/version_0 so there still seems to be a side effect)

Environment

Private, local Jupyter notebook with manually setup virtualenv.

  • PyTorch Version (e.g., 1.0): 1.7.1+cu101
  • OS (e.g., Linux): Linux
  • How you installed PyTorch (conda, pip, source): pip
  • Build command you used (if compiling from source):
  • Python version: 3.6.12
  • CUDA/cuDNN version: 10.1
  • GPU models and configuration: GeForce GTX Titan-X
  • Any other relevant information: None

Additional context

None

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghelp wantedOpen to be worked onpriority: 2Low priority task

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions