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
7731d89d
Commit
7731d89d
authored
Oct 07, 2019
by
Julien Chaumont
Committed by
Yuxin Wu
Oct 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed some deprecation warnings on python 3 (#1337)
parent
bbf29a18
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
4 deletions
+12
-4
tensorpack/dataflow/common.py
tensorpack/dataflow/common.py
+6
-1
tensorpack/tfutils/gradproc.py
tensorpack/tfutils/gradproc.py
+4
-1
tensorpack/utils/logger.py
tensorpack/utils/logger.py
+2
-2
No files found.
tensorpack/dataflow/common.py
View file @
7731d89d
...
...
@@ -5,7 +5,7 @@ from __future__ import division
import
itertools
import
numpy
as
np
import
pprint
from
collections
import
defaultdict
,
deque
,
Mapping
from
collections
import
defaultdict
,
deque
from
copy
import
copy
import
six
import
tqdm
...
...
@@ -17,6 +17,11 @@ from ..utils.utils import get_rng, get_tqdm, get_tqdm_kwargs
from
..utils.develop
import
log_deprecated
from
.base
import
DataFlow
,
DataFlowReentrantGuard
,
ProxyDataFlow
,
RNGDataFlow
try
:
from
collections.abc
import
Mapping
except
ImportError
:
from
collections
import
Mapping
__all__
=
[
'TestDataSpeed'
,
'PrintData'
,
'BatchData'
,
'BatchDataByShape'
,
'FixedSizeData'
,
'MapData'
,
'MapDataComponent'
,
'RepeatedData'
,
'RepeatedDataPoint'
,
'RandomChooseData'
,
'RandomMixData'
,
'JoinData'
,
'ConcatData'
,
'SelectComponent'
,
...
...
tensorpack/tfutils/gradproc.py
View file @
7731d89d
...
...
@@ -119,7 +119,10 @@ class MapGradient(GradientProcessor):
If it return None, the gradient is discarded (hence no update to the variable will happen).
regex (str): used to match variables. Defaults to match all variables.
"""
args
=
inspect
.
getargspec
(
func
)
.
args
if
six
.
PY2
:
args
=
inspect
.
getargspec
(
func
)
.
args
else
:
args
=
inspect
.
getfullargspec
(
func
)
.
args
arg_num
=
len
(
args
)
-
inspect
.
ismethod
(
func
)
assert
arg_num
in
[
1
,
2
],
\
"The function must take 1 or 2 arguments! ({})"
.
format
(
args
)
...
...
tensorpack/utils/logger.py
View file @
7731d89d
...
...
@@ -122,9 +122,9 @@ def set_logger_dir(dirname, action=None):
if
dir_nonempty
(
dirname
):
if
not
action
:
_logger
.
warn
(
"""
\
_logger
.
warn
ing
(
"""
\
Log directory {} exists! Use 'd' to delete it. """
.
format
(
dirname
))
_logger
.
warn
(
"""
\
_logger
.
warn
ing
(
"""
\
If you're resuming from a previous run, you can choose to keep it.
Press any other key to exit. """
)
while
not
action
:
...
...
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