Skip to content

Commit

Permalink
[Fix] Fix collect_env without opencv
Browse files Browse the repository at this point in the history
  • Loading branch information
fanqiNO1 committed Nov 22, 2023
1 parent bdd653a commit 2c5183f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mmengine/utils/dl_utils/collect_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import sys
from collections import OrderedDict, defaultdict

import cv2
import numpy as np
import torch

Expand Down Expand Up @@ -136,7 +135,12 @@ def collect_env():
except ModuleNotFoundError:
pass

env_info['OpenCV'] = cv2.__version__
try:
import cv2
env_info['OpenCV'] = cv2.__version__
except ModuleNotFoundError:
pass

env_info['MMEngine'] = mmengine.__version__

return env_info

0 comments on commit 2c5183f

Please sign in to comment.