'Permission denied: '/tmp/.tensorboard-info/pid-31318.info' when trying to access the tensorboard file after running tensorboard

After running my code which works totally fine, I run tensorboard via terminal with the command 'tensorboard --logdir /work/tensorboard_logs/GLN' I get this error : PermissionError: [Error 13] Permission denied: '/tmp/.tensorboard-info/pid-31452.info' I run the command whoami and I actually am the same user. I checked here https://github.com/tensorflow/models/issues/2641 and tried some of the proposed solutions but still doesn't work for me. PS: I am using jupyter notebook (my own environment) on the server of my school with my account



Solution 1:[1]

I had the same issue and solved it by doing the following (from here):

export TMPDIR=/tmp/USER; 

mkdir -p $TMPDIR;

Solution 2:[2]

I also had the same issue.

This issue occurs because you do not have a permission to access /tmp/.tensorboard-info/ directory which already exists, but tensorboard want to access it.

Therefore,

  1. The first solution is chaining the default temp path environmental variable ($TMPDIR) as commented above.

  2. If you do not want to change $TMPDIR, the second one is to get the permission. If you can get superuser authority, then just give 777 permission.

sudo chmod 777 /tmp/.tensorboard-info
  1. If you do not get superuser authority, then change tensorboard code. In tensorboard-installed directory (probably [PYTHON_INSTALLED_DIR]/lib/python3.7/site-packages/tensorboard )

Please edit ".tensorboard-info" to ".tensorboard-info_custom" in _get_info_dir() function in manager.py

def _get_info_dir():
  """Get path to directory in which to store info files.

  The directory returned by this function is "owned" by this module. If
  the contents of the directory are modified other than via the public
  functions of this module, subsequent behavior is undefined.

  The directory will be created if it does not exist.
  """
  # Change this part  .tensorboard-info->.tensorboard-info_custom
  path = os.path.join(tempfile.gettempdir(), ".tensorboard-info_custom") 
  try:
    os.makedirs(path)
  except OSError as e:
    if e.errno == errno.EEXIST and os.path.isdir(path):
      pass
    else:
      raise
  else:
    os.chmod(path, 0o777)
  return path

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Suraj Rao
Solution 2 yeachan park