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
0e91df43
Commit
0e91df43
authored
Sep 23, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix progress bar in jupyter with type checking
parent
a6394cd9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
tensorpack/utils/utils.py
tensorpack/utils/utils.py
+9
-8
No files found.
tensorpack/utils/utils.py
View file @
0e91df43
...
...
@@ -113,14 +113,15 @@ def get_tqdm_kwargs(**kwargs):
)
f
=
kwargs
.
get
(
'file'
,
sys
.
stderr
)
# os.isatty and f.isatty give different result under jupyter notebook.
# We use os.isatty when stdout/stderr is used, so that jupyter notebook will be recognized as tty.
if
f
==
sys
.
stderr
:
isatty
=
os
.
isatty
(
2
)
elif
f
==
sys
.
stdout
:
isatty
=
os
.
isatty
(
1
)
else
:
isatty
=
f
.
isatty
()
# Jupyter notebook should be recognized as tty.
# Wait for https://github.com/ipython/ipykernel/issues/268
try
:
from
ipykernel
import
iostream
if
isinstance
(
f
,
iostream
.
OutStream
):
isatty
=
True
except
ImportError
:
pass
if
isatty
:
default
[
'mininterval'
]
=
0.5
...
...
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