File tree Expand file tree Collapse file tree 4 files changed +14
-15
lines changed
Expand file tree Collapse file tree 4 files changed +14
-15
lines changed Original file line number Diff line number Diff line change 44from mmdeploy .utils import get_root_logger
55from .version import __version__ # noqa F401
66
7- importlib .import_module ('mmdeploy.pytorch' )
7+ if importlib .util .find_spec ('torch' ):
8+ importlib .import_module ('mmdeploy.pytorch' )
9+ else :
10+ logger = get_root_logger ()
11+ logger .debug ('torch is not installed.' )
812
913if importlib .util .find_spec ('mmcv' ):
1014 importlib .import_module ('mmdeploy.mmcv' )
Original file line number Diff line number Diff line change 2020 lib_dir = os .path .dirname (lib_path )
2121 sys .path .insert (0 , lib_dir )
2222
23- if importlib .util .find_spec (module_name ) is not None :
24- from .wrapper import SDKWrapper
25- __all__ = ['SDKWrapper' ]
26- _is_available = True
23+ try :
24+ if importlib .util .find_spec (module_name ) is not None :
25+ from .wrapper import SDKWrapper
26+ __all__ = ['SDKWrapper' ]
27+ _is_available = True
28+ except Exception :
29+ pass
2730
2831
2932def is_available () -> bool :
Original file line number Diff line number Diff line change 11h5py
22matplotlib
3+ multiprocess
34numpy
45onnx>=1.8.0
56six
Original file line number Diff line number Diff line change 1- import logging
2-
31from setuptools import find_packages , setup
42
53version_file = 'mmdeploy/version.py'
64
7- try :
8- from torch .utils .cpp_extension import BuildExtension
9- cmd_class = {'build_ext' : BuildExtension }
10- except ModuleNotFoundError :
11- cmd_class = {}
12- logging .warning ('Skip building ext ops due to the absence of torch.' )
13-
145
156def readme ():
167 with open ('README.md' , encoding = 'utf-8' ) as f :
@@ -135,5 +126,5 @@ def gen_packages_items():
135126 'optional' : parse_requirements ('requirements/optional.txt' ),
136127 },
137128 ext_modules = [],
138- cmdclass = cmd_class ,
129+ cmdclass = {} ,
139130 zip_safe = False )
You can’t perform that action at this time.
0 commit comments