我正在尝试运行 tensorboard。tensorboard --logdir=runs
. 我也试过了。tensorboard --logdir=runs --host=127.0.0.1
. 我在终端机的目录下运行该命令,其中包含了 runs
文件夹。
我得到以下错误。
[libprotobuf FATAL external/com_google_protobuf/src/google/protobuf/descriptor.cc:1367]
CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size):
libc++abi.dylib: terminating with uncaught exception of type google::protobuf::FatalException:
CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size):
Abort trap: 6
我的Python代码包含以下几行。
tb_path = './runs/SimpleLSTM_MNIST'
if os.path.isdir(tb_path):
shutil.rmtree(tb_path)
writer = tb.SummaryWriter(log_dir=tb_path)
我的 runs
文件夹包含的文件夹 SimpleLSTM_MNIST
含有 events.out.tfevents.1591953948.computername.local.29440.0
.
操作系统: MacOS Catalina
如何解决这个问题?
看起来protobuf不能正常工作,试着安装最新的版本。
pip3 uninstall protobuf
pip3 install protobuf
很明显,这是一个特殊的问题,当运行了 macOS Catalina
,可以通过改用 protobuf version 3.8.0
和tensorflow版本 2.0.0
. 所以基本上卸载了 tensorflow
和 protobuf
并重新安装 pip3 install protobuf==3.8.0
和 pip3 install tensorflow==2.0.0
.