Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Fix bugs in analyze_logs #2184

Merged
merged 5 commits into from Feb 8, 2023

Conversation

Xiangxu-0103
Copy link
Collaborator

@Xiangxu-0103 Xiangxu-0103 commented Dec 29, 2022

Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.

Motivation

Please describe the motivation of this PR and the goal you want to achieve through this PR.

Modification

Usage:

If users want to plot training parameters, take lr as an example:

python tools/analysis_tools/analyze_logs.py plot_curve ${JSON_FILE} --keys lr

If users want to plot evaluation metric, take Overall_3D_AP11_moderate as an example:

python tools/analysis_tools/analyze_logs.py plot_curve ${JSON_FILE} --keys Overall_3D_AP11_moderate --eval --eval-interval ${EVAL_INTERVAL}

BC-breaking (Optional)

Does the modification introduce changes that break the back-compatibility of the downstream repos?
If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR.

Use cases (Optional)

If this PR introduces a new feature, it is better to list some use cases here, and update the documentation.

Checklist

  1. Pre-commit or other linting tools are used to fix the potential lint issues.
  2. The modification is covered by complete unit tests. If not, please add more unit test to ensure the correctness.
  3. If the modification has potential influence on downstream projects, this PR should be tested with downstream projects.
  4. The documentation has been modified accordingly, like docstring or example tutorials.

@codecov
Copy link

codecov bot commented Dec 29, 2022

Codecov Report

Base: 45.23% // Head: 46.39% // Increases project coverage by +1.16% 🎉

Coverage data is based on head (312d0a0) compared to base (edc468b).
Patch has no changes to coverable lines.

Additional details and impacted files
@@             Coverage Diff             @@
##           dev-1.x    #2184      +/-   ##
===========================================
+ Coverage    45.23%   46.39%   +1.16%     
===========================================
  Files          253      259       +6     
  Lines        20729    21401     +672     
  Branches      3275     3379     +104     
===========================================
+ Hits          9377     9930     +553     
- Misses       10733    10827      +94     
- Partials       619      644      +25     
Flag Coverage Δ
unittests 46.39% <ø> (+1.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmdet3d/evaluation/functional/seg_eval.py 96.07% <0.00%> (-3.93%) ⬇️
mmdet3d/models/detectors/imvoxelnet.py 40.84% <0.00%> (-2.71%) ⬇️
mmdet3d/evaluation/metrics/nuscenes_metric.py 11.43% <0.00%> (-0.53%) ⬇️
mmdet3d/evaluation/metrics/waymo_metric.py 8.11% <0.00%> (-0.04%) ⬇️
mmdet3d/registry.py 100.00% <0.00%> (ø)
mmdet3d/utils/typing_utils.py 100.00% <0.00%> (ø)
mmdet3d/engine/hooks/__init__.py 100.00% <0.00%> (ø)
mmdet3d/models/dense_heads/__init__.py 100.00% <0.00%> (ø)
mmdet3d/datasets/transforms/__init__.py 100.00% <0.00%> (ø)
mmdet3d/models/layers/spconv/__init__.py 66.66% <0.00%> (ø)
... and 38 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ZwwWayne ZwwWayne requested review from sunjiahao1999 and removed request for VVsssssk January 18, 2023 11:36
raise KeyError(
f'{args.json_logs[i]} does not contain metric {metric}')

if args.mode == 'eval':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the content of mode eval has been deleted?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The json file does not content mode key. If users want to plot evaluation metric, we can set args.eval to True.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when i run python tools/analysis_tools/analyze_logs.py plot_curve 79.7\ 496\ 432/20230902_001556/vis_data/20230902_001556.json --keys loss --eval
i encounter :ValueError: x and y must have same first dimension, but have shapes (399,) and (400,)
whats this error?

tools/analysis_tools/analyze_logs.py Show resolved Hide resolved
tools/analysis_tools/analyze_logs.py Show resolved Hide resolved
tools/analysis_tools/analyze_logs.py Show resolved Hide resolved
Copy link
Contributor

@JingweiZhang12 JingweiZhang12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Xiangxu-0103 Hi, please update this PR if you have checked the correctness of running.

@Xiangxu-0103
Copy link
Collaborator Author

@Xiangxu-0103 Hi, please update this PR if you have checked the correctness of running.

Have checked this script.

@sunjiahao1999
Copy link
Collaborator

LGTM.

@ZwwWayne ZwwWayne merged commit 6810244 into open-mmlab:dev-1.x Feb 8, 2023
@Xiangxu-0103 Xiangxu-0103 deleted the update_analyze-logs branch February 9, 2023 08:58
@WuYanXingege
Copy link

@Xiangxu-0103 Hi, please update this PR if you have checked the correctness of running.

when i run python tools/analysis_tools/analyze_logs.py plot_curve 79.7\ 496\ 432/20230902_001556/vis_data/20230902_001556.json --keys loss --eval
i encounter :ValueError: x and y must have same first dimension, but have shapes (399,) and (400,)
whats this error?

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.

None yet

5 participants