Skip to content

Commit

Permalink
fix(nyz): correct flake8 style
Browse files Browse the repository at this point in the history
  • Loading branch information
PaParaZz1 committed May 31, 2023
1 parent 4c1c99c commit be254e7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ding/framework/middleware/functional/logger.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from typing import TYPE_CHECKING, Optional, Callable, Dict, List, Union
import os
from ditk import logging
from easydict import EasyDict
from matplotlib import pyplot as plt
from matplotlib import animation
from matplotlib import ticker as mtick
from torch.nn import functional as F
import os
import numpy as np
import torch
import wandb
import h5py
import pickle
import treetensor.numpy as tnp
from ding.framework import task
Expand Down Expand Up @@ -351,6 +351,12 @@ def _vis_dataset(datasetpath: str):
import sys
logging.warning("Please install sklearn first, such as `pip3 install scikit-learn`.")
sys.exit(1)
try:
import h5py
except ImportError:
import sys
logging.warning("Please install h5py first, such as `pip3 install h5py`.")
sys.exit(1)
assert os.path.splitext(datasetpath)[-1] in ['.pkl', '.h5', '.hdf5']
if os.path.splitext(datasetpath)[-1] == '.pkl':
with open(datasetpath, 'rb') as f:
Expand Down

0 comments on commit be254e7

Please sign in to comment.