{"id":8765,"library":"visualdl","title":"VisualDL","description":"VisualDL is a deep learning visualization tool from PaddlePaddle that helps design and debug deep learning jobs. It offers features for visualizing scalars, parameter distributions, model structures, images, audio, text, high-dimensional data, and more. It is actively developed, with new features continuously added.","status":"active","version":"2.5.3","language":"en","source_language":"en","source_url":"https://github.com/PaddlePaddle/VisualDL","tags":["deep learning","visualization","paddlepaddle","pytorch","onnx","metrics","debugging"],"install":[{"cmd":"pip install --upgrade visualdl","lang":"bash","label":"Latest stable release"}],"dependencies":[{"reason":"Required for logging, older versions can cause runtime errors.","package":"protobuf","optional":false}],"imports":[{"note":"The primary class for writing log data to be visualized.","symbol":"LogWriter","correct":"from visualdl import LogWriter"}],"quickstart":{"code":"import random\nfrom visualdl import LogWriter\nimport os\n\n# Create a log directory\nlogdir = os.path.join(os.environ.get('VISUALDL_LOGDIR', './visualdl_logs'))\nos.makedirs(logdir, exist_ok=True)\n\n# Initialize LogWriter\n# The sync_cycle parameter specifies how often data should be written to disk.\nlogger = LogWriter(logdir=logdir, sync_cycle=1000)\n\n# Log scalar data\nwith logger.mode(\"train\"):\n    scalar_writer = logger.scalar(\"scalars/loss\")\n    for step in range(100):\n        scalar_writer.add_record(step, random.random() * 10)\n\nwith logger.mode(\"eval\"):\n    scalar_writer = logger.scalar(\"scalars/accuracy\")\n    for step in range(100):\n        scalar_writer.add_record(step, random.random())\n\nprint(f\"VisualDL logs saved to: {logdir}\")\nprint(f\"To view, run in your terminal: visualdl --logdir {logdir}\")","lang":"python","description":"This quickstart code demonstrates how to initialize a `LogWriter` and record scalar data over multiple steps for both 'train' and 'eval' modes. After running this script, launch the VisualDL board from your terminal using the provided command to view the generated visualizations."},"warnings":[{"fix":"`pip install --upgrade protobuf`","message":"Running VisualDL might result in `TypeError: __init__() got an unexpected keyword argument 'file'` if your `protobuf` library version is too old (not 3.5+).","severity":"gotcha","affected_versions":"All versions of VisualDL when used with `protobuf < 3.5`."},{"fix":"Update `LogReader(file_name=...)` to `LogReader(file_path=...)`.","message":"In VisualDL v2.1.0 and later, the `LogReader` class changed a parameter name from `file_name` to `file_path`. Older code using `file_name` will break.","severity":"breaking","affected_versions":"v2.1.0 and later"},{"fix":"Ensure your development environment uses Python 3.x.","message":"VisualDL officially dropped support for Python 2 on January 1, 2020. While older versions might technically work, Python 3 is now required for full functionality, new features, and continued updates.","severity":"deprecated","affected_versions":"v2.0.0 and later"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"`pip install --upgrade protobuf`","cause":"The installed `protobuf` library version is outdated (older than 3.5), leading to an API incompatibility with VisualDL.","error":"TypeError: __init__() got an unexpected keyword argument 'file'"},{"fix":"Ensure your virtual environment (e.g., conda or venv) where VisualDL was installed is activated. Alternatively, use `python -m visualdl.server --logdir ...` to explicitly invoke VisualDL with the correct Python interpreter. If the issue persists, consider reinstalling VisualDL within a fresh virtual environment.","cause":"This typically indicates a mismatch between the Python interpreter used to run the `visualdl` command/module and the Python environment where VisualDL was originally installed. This often happens outside of an activated virtual environment.","error":"ModuleNotFoundError: No module named 'visualdl' OR Abort trap: 6 (when running visualdl command)"}]}