I am still experiencing this error and can not resolve (please note I am aware of https://github.com/tensorflow/tensorboard/issues/2279
AND
https://github.com/tensorflow/tensorflow/issues/26732 AND
https://github.com/tensorflow/tensorflow/issues/26021 AND
https://github.com/tensorflow/tensorboard/issues/2279)
The code below "should" work according to the documentation of these issues but does NOT
BASE_DATA_PATH = 'C:/Grewe/Classes/CS663/Mat/LSTM/data'
BASE_DATA_PATH = 'C:\Grewe\Classes\CS663\Mat\LSTM\data'
mylog_dir = os.path.join( BASE_DATA_PATH, "train_log")
print("Mylog directory = " + mylog_dir)
tensorboard_callback = tf.keras.callbacks.TensorBoard(log_dir=mylog_dir, update_freq=1000)
print(os.path.join(mylog_dir, 'train'))
tensorboard_callback = tf.keras.callbacks.TensorBoard(os.path.join('tmp'), update_freq=1000)
model.fit(train_dataset, epochs=17, callbacks=[tensorboard_callback], validation_data=valid_dataset)
*OUTPUT following ****
((((NOTE: see the end where trying to create a directory UnknownError: FileNotFoundError: [Errno 2] No such file or directory: 'C:/Grewe/Classes/CS663/Mat/LSTM/data/UCF-101\CricketBowling/v_CricketBowling_g25_c06.npy ---THIS IS THE PROBLEM--- NOTE: I have tried both BASE_DIRECTORY options above and both do not work!!!! in other case when TensorBoard creating the train subdirectory puts slash as / and then error if I specify the path with \ slashes. ))))
Mylog directory = C:\Grewe\Classes\CS663\Mat\LSTM\data\train_log
C:\Grewe\Classes\CS663\Mat\LSTM\data\train_log\train
Epoch 1/17
WARNING:tensorflow:Trace already enabled
1/Unknown - 2s 2s/step - loss: 4.7203 - accuracy: 0.0625 - top_k_categorical_accuracy: 0.062 - 2s 2s/step - loss: 4.7203 - accuracy: 0.0625 - top_k_categorical_accuracy: 0.0625
UnknownError Traceback (most recent call last)
~\AppData\Roaming\Python\Python36\site-packages\tensorflow_core\python\keras\engine\training_v2.py in on_batch(self, step, mode, size)
695 try:
--> 696 yield batch_logs
697 finally:
~\AppData\Roaming\Python\Python36\site-packages\tensorflow_core\python\keras\engine\training_v2.py in run_one_epoch(model, iterator, execution_function, dataset_size, batch_size, strategy, steps_per_epoch, num_samples, mode, training_context, total_epochs)
122 try:
--> 123 batch_outs = execution_function(iterator)
124 except (StopIteration, errors.OutOfRangeError):
~\AppData\Roaming\Python\Python36\site-packages\tensorflow_core\python\keras\engine\training_v2_utils.py in execution_function(input_fn)
85 return nest.map_structure(_non_none_constant_value,
---> 86 distributed_function(input_fn))
87
~\AppData\Roaming\Python\Python36\site-packages\tensorflow_core\python\eager\def_function.py in call(self, args, kwds)
456 tracing_count = self._get_tracing_count()
--> 457 result = self._call(args, **kwds)
458 if tracing_count == self._get_tracing_count():
~\AppData\Roaming\Python\Python36\site-packages\tensorflow_core\python\eager\def_function.py in _call(self, args, kwds)
486 # defunned version which is guaranteed to never create variables.
--> 487 return self._stateless_fn(args, **kwds) # pylint: disable=not-callable
488 elif self._stateful_fn is not None:
~\AppData\Roaming\Python\Python36\site-packages\tensorflow_core\python\eager\function.py in call(self, args, *kwargs)
1822 graph_function, args, kwargs = self._maybe_define_function(args, kwargs)
-> 1823 return graph_function._filtered_call(args, kwargs) # pylint: disable=protected-access
1824
~\AppData\Roaming\Python\Python36\site-packages\tensorflow_core\python\eager\function.py in _filtered_call(self, args, kwargs)
1140 resource_variable_ops.BaseResourceVariable))),
-> 1141 self.captured_inputs)
1142
~\AppData\Roaming\Python\Python36\site-packages\tensorflow_core\python\eager\function.py in _call_flat(self, args, captured_inputs, cancellation_manager)
1223 flat_outputs = forward_function.call(
-> 1224 ctx, args, cancellation_manager=cancellation_manager)
1225 else:
~\AppData\Roaming\Python\Python36\site-packages\tensorflow_core\python\eager\function.py in call(self, ctx, args, cancellation_manager)
510 attrs=("executor_type", executor_type, "config_proto", config),
--> 511 ctx=ctx)
512 else:
~\AppData\Roaming\Python\Python36\site-packages\tensorflow_core\python\eager\execute.py in quick_execute(op_name, num_outputs, inputs, attrs, ctx, name)
66 message = e.message
---> 67 six.raise_from(core._status_to_exception(e.code, message), None)
68 except TypeError as e:
c:\python36\lib\site-packages\six.py in raise_from(value, from_value)
UnknownError: FileNotFoundError: [Errno 2] No such file or directory: 'C:/Grewe/Classes/CS663/Mat/LSTM/data/UCF-101\CricketBowling/v_CricketBowling_g25_c06.npy'
Traceback (most recent call last):
该提问来源于开源项目:tensorflow/tensorboard
I got it to work ---really weird --had to restart the kernel --something must have been wrong.