Skip to content

Commit

Permalink
add mxnet version check (#301)
Browse files Browse the repository at this point in the history
* add mxnet version check

* fix lint

* correct version

* fix import order
  • Loading branch information
zhreshold authored Sep 7, 2018
1 parent b30cdf3 commit 9669d72
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions gluoncv/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
# coding: utf-8
# pylint: disable=wrong-import-position
"""GluonCV: a deep learning vision toolkit powered by Gluon."""
from __future__ import absolute_import

# mxnet version check
mx_version = '1.3.0'
try:
import mxnet as mx
import warnings
from distutils.version import LooseVersion
if LooseVersion(mx.__version__) < LooseVersion(mx_version):
msg = (
"Legacy mxnet=={} detected, some new modules may not work properly. "
"mxnet>={} is recommended. You can use pip to upgrade mxnet "
"`pip install mxnet --pre --upgrade`").format(mx.__version__, mx_version)
warnings.warn(msg)
except ImportError:
raise ImportError(
"Unable to import dependency mxnet. "
"A quick tip is to install via `pip install mxnet --pre`. "
"please refer to https://gluon-cv.mxnet.io/#installation for details.")

__version__ = '0.3.0'

from . import data
Expand Down

0 comments on commit 9669d72

Please sign in to comment.