Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
seminar-breakout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
seminar-breakout
Commits
57a81ade
Commit
57a81ade
authored
Aug 05, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid import matplotlib and sklearn at first (#363)
parent
02ef551b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
8 deletions
+3
-8
tensorpack/__init__.py
tensorpack/__init__.py
+1
-1
tensorpack/dataflow/format.py
tensorpack/dataflow/format.py
+1
-5
tensorpack/utils/__init__.py
tensorpack/utils/__init__.py
+1
-2
No files found.
tensorpack/__init__.py
View file @
57a81ade
...
...
@@ -5,9 +5,9 @@
from
tensorpack.libinfo
import
__version__
from
tensorpack.utils
import
*
from
tensorpack.models
import
*
from
tensorpack.dataflow
import
*
from
tensorpack.utils
import
*
from
tensorpack.callbacks
import
*
from
tensorpack.tfutils
import
*
...
...
tensorpack/dataflow/format.py
View file @
57a81ade
...
...
@@ -235,6 +235,7 @@ class SVMLightData(RNGDataFlow):
filename (str): input file
shuffle (bool): shuffle the data
"""
import
sklearn.datasets
# noqa
self
.
X
,
self
.
y
=
sklearn
.
datasets
.
load_svmlight_file
(
filename
)
self
.
X
=
np
.
asarray
(
self
.
X
.
todense
())
self
.
shuffle
=
shuffle
...
...
@@ -287,11 +288,6 @@ except ImportError:
for
klass
in
[
'LMDBData'
,
'LMDBDataDecoder'
,
'LMDBDataPoint'
,
'CaffeLMDB'
]:
globals
()[
klass
]
=
create_dummy_class
(
klass
,
'lmdb'
)
try
:
import
sklearn.datasets
except
ImportError
:
SVMLightData
=
create_dummy_class
(
'SVMLightData'
,
'sklearn'
)
# noqa
try
:
import
tensorflow
as
tf
except
ImportError
:
...
...
tensorpack/utils/__init__.py
View file @
57a81ade
...
...
@@ -37,5 +37,4 @@ for _, module_name, _ in iter_modules(
continue
if
module_name
in
_TO_IMPORT
:
_global_import
(
module_name
)
else
:
__all__
.
append
(
module_name
)
__all__
.
extend
([
'logger'
])
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment