Skip to content

Failed to create a directory: ./logdir\train\2017-04-16T14-17-39 #255

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
aayush3011 opened this issue Apr 16, 2017 · 24 comments
Open

Failed to create a directory: ./logdir\train\2017-04-16T14-17-39 #255

aayush3011 opened this issue Apr 16, 2017 · 24 comments

Comments

@aayush3011
Copy link

I am having the following error when trying to train the VCTK-Corpus. I am using tensorflow version "0.12.1". Does anybody knows how to resolve this error.

Using default logdir: ./logdir\train\2017-04-16T14-17-39
Traceback (most recent call last):
File "E:/Spring 2017/CS 523/project 3/part-3/tensorflow-wavenet-master/tensorflow-wavenet-master/train.py", line 337, in
main()
File "E:/Spring 2017/CS 523/project 3/part-3/tensorflow-wavenet-master/tensorflow-wavenet-master/train.py", line 263, in main
writer = tf.summary.FileWriter(logdir)
File "C:\Anaconda3\lib\site-packages\tensorflow\python\summary\writer\writer.py", line 308, in init
event_writer = EventFileWriter(logdir, max_queue, flush_secs)
File "C:\Anaconda3\lib\site-packages\tensorflow\python\summary\writer\event_file_writer.py", line 69, in init
gfile.MakeDirs(self._logdir)
File "C:\Anaconda3\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 299, in recursive_create_dir
pywrap_tensorflow.RecursivelyCreateDir(compat.as_bytes(dirname), status)
File "C:\Anaconda3\lib\contextlib.py", line 66, in exit
next(self.gen)
File "C:\Anaconda3\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 469, in raise_exception_on_not_ok_status
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.NotFoundError: Failed to create a directory: ./logdir\train\2017-04-16T14-17-39

@devinplatt
Copy link
Contributor

I'm not a Windows user, but maybe you need to use .\logdir\train\2017-04-16T14-17-39 instead of ./logdir\train\2017-04-16T14-17-39 ? It looks like this is the default logdir though, so try specifying the logdir directly as a command line argument.

@racheljchen
Copy link

racheljchen commented Dec 3, 2017

I am also having a similar issue: but with ./logdir

Using default logdir: ./logdir/train/2017-12-03T23-24-51
Traceback (most recent call last):
File "train.py", line 337, in
main()
File "train.py", line 263, in main
writer = tf.summary.FileWriter(logdir)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/summary/writer/writer.py", line 336, in init
filename_suffix)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/summary/writer/event_file_writer.py", line 67, in init
gfile.MakeDirs(self._logdir)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/lib/io/file_io.py", line 367, in recursive_create_dir
pywrap_tensorflow.RecursivelyCreateDir(compat.as_bytes(dirname), status)
File "/usr/lib/python2.7/contextlib.py", line 24, in exit
self.gen.next()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/errors_impl.py", line 466, in raise_exception_on_not_ok_status
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.PermissionDeniedError: ./logdir

@devinroth
Copy link

devinroth commented Dec 3, 2017 via email

@racheljchen
Copy link

realized I was in the wrong directory for tensorflow-wavenet (was using another implementation of it). switched to the folder pulled directly from cloning this project and it didn't give me this problem anymore.

@aishweta
Copy link

I'm having same problem with logdir pl help me

@mcgrimm
Copy link

mcgrimm commented Sep 7, 2018

I also have such issue ,but resolved by below command
python -m retrain --bottleneck_dir=bottlenecks --how_many_training_steps=500 --model_dir=models --summaries_dir=tf_files --output_graph=retrained.pb --output_labels=retrained_labels.txt --architecture="mobilenet_0.50_224" --image_dir=flower_photos

above is my command run successfully in windows 10

@KashyapKishore
Copy link

KashyapKishore commented Oct 9, 2018

I think this is simply a 'path' issue. In Windows, just modify the Log directory ROOT from LOGDIR_ROOT = ./logdir to LOGDIR_ROOT = 'logdir'

@arghyachaks
Copy link

In Windows, create folder manually.

@hallibay
Copy link

In Windows, create folder manually.

please can you explain further, do you mean the logs folder should be created manually

@windowshopr
Copy link

@hallibay Yes, I had this issue too on my Windows 10 machine. My error looked like this:

NotFoundError: Failed to create a directory: ./23_logs\train\plugins\profile\2019-11-11_13-02-07; No such file or directory

So, for me, within the directory of my project's .py file, or whichever folder I'm running the program from, I needed to manually create a folder called 23_logs, then within that folder, manually create a new folder called train, and then within the train folder, create a new folder called plugins, and again for profile. Then I just re-ran the program and it worked. Not sure why TF doesn't just make the directory's as it needs but whatever. Hope that helps?

@StenkinVlad
Copy link

I am having the following error when trying to train the VCTK-Corpus. I am using tensorflow version "0.12.1". Does anybody knows how to resolve this error.
...
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.NotFoundError: Failed to create a directory: ./logdir\train\2017-04-16T14-17-39

Fix that worked for me in Windows10
Instead of path suggested by TF tutorial:
log_dir="logs/fit/" + datetime.datetime.now().strftime("%Y%m%d-%H%M%S")

Use this:
log_dir="logs\\fit\\" + datetime.datetime.now().strftime("%Y%m%d-%H%M%S")

@yashyennam
Copy link

I found out the solution.

just replace the path with "r" in the beginning in the code wherever the path strings are mentioned.

ex.
instead of :
log_dir="logs/fit/" + datetime.datetime.now().strftime("%Y%m%d-%H%M%S")

try this:
log_dir=r"logs/fit/" + datetime.datetime.now().strftime("%Y%m%d-%H%M%S")

@srinivascnu166
Copy link

I am having the following error when trying to train the VCTK-Corpus. I am using tensorflow version "0.12.1". Does anybody knows how to resolve this error.
...
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.NotFoundError: Failed to create a directory: ./logdir\train\2017-04-16T14-17-39

Fix that worked for me in Windows10
Instead of path suggested by TF tutorial:
log_dir="logs/fit/" + datetime.datetime.now().strftime("%Y%m%d-%H%M%S")

Use this:
log_dir="logs\\fit\\" + datetime.datetime.now().strftime("%Y%m%d-%H%M%S")

This worked for me..thanks@StenkinVlad

@NamanDhameja
Copy link

NamanDhameja commented Mar 26, 2020

Failed to create a directory: Logs\20200303/27/20-013517\train; No such file or directory [Op:CreateSummaryFileWriter]

I am using windows 10.
Found the solution for this:
log_dir=os.path.join('logs',datetime.datetime.now().strftime("%Y%m%D"))
change it to single quotes.

@Terkea
Copy link

Terkea commented Apr 4, 2020

I am having the following error when trying to train the VCTK-Corpus. I am using tensorflow version "0.12.1". Does anybody knows how to resolve this error.
...
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.NotFoundError: Failed to create a directory: ./logdir\train\2017-04-16T14-17-39

Fix that worked for me in Windows10
Instead of path suggested by TF tutorial:
log_dir="logs/fit/" + datetime.datetime.now().strftime("%Y%m%d-%H%M%S")

Use this:
log_dir="logs\\fit\\" + datetime.datetime.now().strftime("%Y%m%d-%H%M%S")

this worked for me.

@NEMO-WXL
Copy link

NEMO-WXL commented May 4, 2020

I am having the following error when trying to train the VCTK-Corpus. I am using tensorflow version "0.12.1". Does anybody knows how to resolve this error.
...
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.NotFoundError: Failed to create a directory: ./logdir\train\2017-04-16T14-17-39

Fix that worked for me in Windows10
Instead of path suggested by TF tutorial:
log_dir="logs/fit/" + datetime.datetime.now().strftime("%Y%m%d-%H%M%S")

Use this:
log_dir="logs\\fit\\" + datetime.datetime.now().strftime("%Y%m%d-%H%M%S")

@NEMO-WXL
Copy link

NEMO-WXL commented May 4, 2020

it worked,thank you

@Benedetto05
Copy link

I had the same issue with the log file location for tensorboard. The following quick fix worked for me on Win10:

  1. use pathlib to define your paths:
    from pathlib import Path
  2. provide Path object for tensorboard:
    target_dir_tb = Path.cwd() / "logs" / ... # specify location for tensorboard files in a Path object
    tb = TensorBoard(log_dir=target_dir_tb, # this must be a Path object!
    histogram_freq=15,
    batch_size=batch_size,
    write_graph=True,
    write_grads=True)

@prudhvi0394
Copy link

Doesn't it work if i have used os instead of path ? I have used all these things to set path but it still seems to be taking the wrong path

@mthomp89
Copy link

I am having the following error when trying to train the VCTK-Corpus. I am using tensorflow version "0.12.1". Does anybody knows how to resolve this error.
...
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.NotFoundError: Failed to create a directory: ./logdir\train\2017-04-16T14-17-39

Fix that worked for me in Windows10
Instead of path suggested by TF tutorial:
log_dir="logs/fit/" + datetime.datetime.now().strftime("%Y%m%d-%H%M%S")

Use this:
log_dir="logs\\fit\\" + datetime.datetime.now().strftime("%Y%m%d-%H%M%S")

@NEMO-WXL replacing the slashes worked. What is the purpose behind the replacement? Is this a windows specific fix?

@ozert
Copy link

ozert commented Aug 1, 2020

I am having the following error when trying to train the VCTK-Corpus. I am using tensorflow version "0.12.1". Does anybody knows how to resolve this error.
...
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.NotFoundError: Failed to create a directory: ./logdir\train\2017-04-16T14-17-39

Fix that worked for me in Windows10
Instead of path suggested by TF tutorial:
log_dir="logs/fit/" + datetime.datetime.now().strftime("%Y%m%d-%H%M%S")
Use this:
log_dir="logs\\fit\\" + datetime.datetime.now().strftime("%Y%m%d-%H%M%S")

This worked for me..thanks@StenkinVlad

@mahdibidar
Copy link

I think this is simply a 'path' issue. In Windows, just modify the Log directory ROOT from LOGDIR_ROOT = ./logdir to LOGDIR_ROOT = 'logdir'

Thanks :)

@Tony-Yan2018
Copy link

This bug still exists on Windows:
tbCall = TensorBoard(log_dir='./log/1000')
turns out to be :

tensorflow.python.framework.errors_impl.NotFoundError: Failed to create a directory: ./log/1000\train; No such file or directory

Anyone can help? Thanks!

@diman82
Copy link

diman82 commented Feb 22, 2021

What helped me, is wrapping the path with Path object (from pathlib module) and converting back to str

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests