Tensorboard: OSError: [Errno 22] Invalid argument when trying to run tensorflow from command prompt

4.2k Views Asked by At

Every time I try to run tensorboard using command:

tensorboard --logdir=logs/ --host=127.0.0.1 in command prompt after navigating to logs directory I get this error: OSError: [Errno 22] Invalid argument. I am using TensorBoard version 1.13.1 I have used the following command in my code:

tensorboard = TensorBoard(log_dir='<My/Path/To/Tensorflow/Log/Directory>')

and called it using:

`clf.fit(X,y,batch_size=30,
          epochs=15,
          validation_split=0.4,
          callbacks=[tensorboard]
       )`
4

There are 4 best solutions below

0
Lilly On

I had the same problem. It took me ages to figure out, but for me it worked to upgrade the Interpreter to Python 3.7.2 Which version are you currently using?

0
LaloGo On

Had the same problem. As mentioned in this issue this problem is related to a bug in Python 3.6. You could fix it upgrading to Python 3.7. Check the aforementioned issue tracker for more info.

1
Ankush On

Encountered this problem with Python 3.7.0 too.

Invalid Arguments

Following solution worked.

Go to <Home_DIR>\Anaconda3\lib\site-packages\tensorboard\

Change manager.py

From:

serialize=lambda dt: int(dt - datetime.datetime.fromtimestamp(0)).total_seconds()),

To:

serialize=lambda dt: int(dt.strftime("%S")),

manager.py

Original source: http://www.programmersought.com/article/2977784478/

0
Sudheer Raja On

Tensorboard 1.13.1 has a compatibility issue with Tensorflow 1.14.0rc1. Upgrading to the latest Tensorboard version fixes this issue.

Install latest Tensorboard version, which is the nightly build currently on the top of Tensorboard 1.13.1. It should solve the problem.

pip install tb-nightly

I tested this with the following configuration and it worked for me.

Python 3.6.6
Tensorflow 1.14.0rc1
Tensorboard 1.13.1
tb-nightly 1.14.0a20190611

References:

  1. https://github.com/tensorflow/tensorboard/issues/2106
  2. https://github.com/tensorflow/probability/issues/354