ChristianBergler / ANIMAL-SPOT

An Animal Independent Deep Learning Framework for Bioacoustic Signal Segmentation and Classification Including a Detailed User-Guide
GNU General Public License v3.0
35 stars 5 forks source link

tensorboard evaluation not working #5

Closed canihaveabravo closed 8 months ago

canihaveabravo commented 8 months ago

Hi I hope you can help. I am having trouble running the tensorboard summaries with the code tensorboard --logdir /*PathToNetworkSummaryFolder*/summaries/

Could you please provide some advice if this feature is working? I have trained a model and run prediction and output a raven annotation table. But I would really like to view the performance metrics in tensorboard.

error message:


Traceback (most recent call last):
  File "C:\Users\lscala\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\lscala\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\lscala\AppData\Local\Programs\Python\Python310\Scripts\tensorboard.exe\__main__.py", line 4, in <module>
  File "C:\Users\lscala\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorboard\main.py", line 27, in <module>
    from tensorboard import default
  File "C:\Users\lscala\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorboard\default.py", line 33, in <module>
    from tensorboard.plugins.audio import audio_plugin
  File "C:\Users\lscala\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorboard\plugins\audio\audio_plugin.py", line 25, in <module>
    from tensorboard.data import provider
  File "C:\Users\lscala\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorboard\data\__init__.py", line 17, in <module>
    from tensorboard.data import experimental  # noqa: F401
  File "C:\Users\lscala\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorboard\data\experimental\__init__.py", line 17, in <module>
    from tensorboard.data.experimental.experiment_from_dev import (  # noqa: F401
  File "C:\Users\lscala\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorboard\data\experimental\experiment_from_dev.py", line 27, in <module>
    from tensorboard.uploader import server_info as server_info_lib
  File "C:\Users\lscala\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorboard\uploader\server_info.py", line 23, in <module>
    from tensorboard.plugins.scalar import metadata as scalars_metadata
  File "C:\Users\lscala\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorboard\plugins\scalar\metadata.py", line 18, in <module>
    from tensorboard.compat.proto import summary_pb2
  File "C:\Users\lscala\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorboard\compat\proto\summary_pb2.py", line 17, in <module>
    from tensorboard.compat.proto import tensor_pb2 as tensorboard_dot_compat_dot_proto_dot_tensor__pb2
  File "C:\Users\lscala\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorboard\compat\proto\tensor_pb2.py", line 16, in <module>
    from tensorboard.compat.proto import resource_handle_pb2 as tensorboard_dot_compat_dot_proto_dot_resource__handle__pb2
  File "C:\Users\lscala\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorboard\compat\proto\resource_handle_pb2.py", line 16, in <module>
    from tensorboard.compat.proto import tensor_shape_pb2 as tensorboard_dot_compat_dot_proto_dot_tensor__shape__pb2
  File "C:\Users\lscala\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorboard\compat\proto\tensor_shape_pb2.py", line 36, in <module>
    _descriptor.FieldDescriptor(
  File "C:\Users\lscala\AppData\Local\Programs\Python\Python310\lib\site-packages\google\protobuf\descriptor.py", line 561, in __new__
    _message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates```

Thanks for your help,
Lorenzo
ChristianBergler commented 8 months ago

Hi Lorenzo, I am not sure whether you are using the correct "tensorboard" module? I can only guess from your command line output you are working on a Windows System and using tensorboard.exe. First of all, of course, this feature is working.

As it is written in the documentation via the command: tensorboard --logdir /PathToNetworkSummaryFolder/summaries/ you can observe the performance metrics. Once you have trained your model you got an output folder with all your results: trained model as pickle file, a directory which includes the stored checkpoints, a logging file, and a directory which includes the tensorboard-relevant summary files. The folder name is specified via the command line parameter --summary_directory, which needs to be defined as part of the training procedure.

So the command above, together with this "summary folder name" (absolute path) should start tensorboard and present a link (local host) with a web-interface (GUI). By opening the link it should display your training/validation/test metrics. I assume that you either used a wrong path, OR something tensorboard-related is wrong on your system. Because it says also "Descripotrs cannot be created directly" and so on. So, could be something Python- and/or Tensorboard-related as well. Apart from the mentioned "challenges" i don't think it is a ANIMAL-SPOT related problem, to be honest.

Best, Christian

canihaveabravo commented 8 months ago

Hi Christian, thanks for the info. I managed to get tensorboard working.