Commit 8a221643 authored by Yuxin Wu's avatar Yuxin Wu

fix horovod import in rtd

parent cc2df915
......@@ -30,7 +30,7 @@ MOCK_MODULES = ['scipy', 'tabulate',
'cv2', 'scipy.io', 'dill', 'zmq', 'subprocess32', 'lmdb',
'tornado.concurrent', 'tornado',
'msgpack', 'msgpack_numpy',
'gym', 'functools32', 'horovod.tensorflow']
'gym', 'functools32', 'horovod', 'horovod.tensorflow']
for mod_name in MOCK_MODULES:
sys.modules[mod_name] = mock.Mock(name=mod_name)
sys.modules['cv2'].__version__ = '3.2.1' # fake version
......
......@@ -268,5 +268,8 @@ class HorovodTrainer(SingleCostTrainer):
from ..utils.develop import create_dummy_class # noqa
try:
import horovod.tensorflow as hvd
except ImportError:
HorovodTrainer = create_dummy_class('HovorodTrainer', 'horovod') # noqa
except Exception: # could be other than ImportError, e.g. NCCL not found
print("Horovod is installed but cannot be imported.")
HorovodTrainer = create_dummy_class('HovorodTrainer', 'horovod') # noqa
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment