Skip to content

Fix ValueError from space in metrics filename#1

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-invalid-file-format
Draft

Fix ValueError from space in metrics filename#1
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-invalid-file-format

Conversation

Copilot AI commented Nov 26, 2025

Copy link
Copy Markdown

The evaluate.py script fails with ValueError: Format ' png' is not supported due to a typo in the metrics filename on line 79.

Changes

  • evaluate.py:79: Remove space in 'metrics. png''metrics.png'
  • Add .gitignore: Exclude Python cache files and build artifacts
# Before
metrics_path = config.LOG_DIR / 'metrics. png'

# After  
metrics_path = config.LOG_DIR / 'metrics.png'

The space caused matplotlib to interpret the format as ' png' instead of 'png', triggering the format validation error.

Original prompt

问题描述

运行 evaluate.py 时出现以下错误:

ValueError: Format ' png' is not supported (supported formats: eps, jpeg, jpg, pdf, pgf, png, ps, raw, rgba, svg, svgz, tif, tiff, webp)

原因

evaluate.py 第 79 行,文件名 'metrics. png' 中点号和扩展名之间有一个多余的空格,导致格式被错误识别为 ' png' 而不是 'png'

解决方案

将第 79 行的:

metrics_path = config.LOG_DIR / 'metrics. png'

修改为:

metrics_path = config.LOG_DIR / 'metrics.png'

删除 metrics.png 之间的空格。

修复文件

  • evaluate.py 第 79 行

This pull request was created as a result of the following prompt from Copilot chat.

问题描述

运行 evaluate.py 时出现以下错误:

ValueError: Format ' png' is not supported (supported formats: eps, jpeg, jpg, pdf, pgf, png, ps, raw, rgba, svg, svgz, tif, tiff, webp)

原因

evaluate.py 第 79 行,文件名 'metrics. png' 中点号和扩展名之间有一个多余的空格,导致格式被错误识别为 ' png' 而不是 'png'

解决方案

将第 79 行的:

metrics_path = config.LOG_DIR / 'metrics. png'

修改为:

metrics_path = config.LOG_DIR / 'metrics.png'

删除 metrics.png 之间的空格。

修复文件

  • evaluate.py 第 79 行

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits November 26, 2025 11:52
Co-authored-by: Jie-Huangi <92194051+Jie-Huangi@users.noreply.github.com>
Co-authored-by: Jie-Huangi <92194051+Jie-Huangi@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix unsupported format error in evaluate.py Fix ValueError from space in metrics filename Nov 26, 2025
Copilot AI requested a review from Jie-Huangi November 26, 2025 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants