Open zhh1997zhh opened 4 years ago
I had the same error, and I tried to fix it by adding
import tensorflow as tf
import tensorboard as tb
tf.io.gfile = tb.compat.tensorflow_stub.io.gfile
This seems to have run the code without running into any error. However, the projector tab was not shown on tensorboard. There's an error when I ran the tensorboard command tensorboard --logdir=./log
.
Below is my error message.
Exception in thread ProjectorPluginIsActiveThread:
Traceback (most recent call last):
File "/Users/keweizhou/anaconda3/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/Users/keweizhou/anaconda3/lib/python3.7/threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "/Users/keweizhou/anaconda3/lib/python3.7/site-packages/tensorboard/plugins/projector/projector_plugin.py", line 326, in _determine_is_active
if self.configs:
File "/Users/keweizhou/anaconda3/lib/python3.7/site-packages/tensorboard/plugins/projector/projector_plugin.py", line 344, in configs
self._augment_configs_with_checkpoint_info()
File "/Users/keweizhou/anaconda3/lib/python3.7/site-packages/tensorboard/plugins/projector/projector_plugin.py", line 366, in _augment_configs_with_checkpoint_info
tensor = _read_tensor_tsv_file(fpath)
File "/Users/keweizhou/anaconda3/lib/python3.7/site-packages/tensorboard/plugins/projector/projector_plugin.py", line 153, in _read_tensor_tsv_file
for line in f:
File "/Users/keweizhou/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/lib/io/file_io.py", line 220, in __next__
return self.next()
File "/Users/keweizhou/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/lib/io/file_io.py", line 214, in next
retval = self.readline()
File "/Users/keweizhou/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/lib/io/file_io.py", line 178, in readline
self._preread_check()
File "/Users/keweizhou/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/lib/io/file_io.py", line 84, in _preread_check
compat.as_bytes(self.__name), 1024 * 512)
tensorflow.python.framework.errors_impl.NotFoundError: ./log/00000/category embedding/tensors.tsv; No such file or directory
When I checked my category embedding
folder, there's only one file named metadata.tsv
@zhh1997zhh I think you need to add the --warm_start
flag to your initial command so that you have a model from which to extract the embedding.
@zhh1997zhh and @keweizhou1999 This error is caused by having incompatible versions of tensorboard and pytorch. I'm not sure if the fix proposed by @keweizhou1999 will work correctly, or if it just silently masks the error. See #40 for the versions of all libraries that I used.
Thank you! Both suggestions are helpful!
When I run the following command for part 3:
python3 names.py --embed --log_dir=./log
I get an attribute error like this:
My code for part 3 is:
May I know how should I fix the problem?