Comments (18)
Error on colab, with fastai2, @ learn.fit_one_cycle(4):
AttributeError: ‘NBMasterBar’ object has no attribute ‘out’
AttributeError: ‘NBMasterBar’ object has no attribute ‘start_t’
from fastprogress.
@tunner007 The reason why upgrading doesn't help is that the interactive REPL prompt ignores the user's enviroment for its dependencies, so even after an upgrade it still uses the old version:
> !pip3 freeze | grep ipython
ipython==7.9.0
ipython-genutils==0.2.0
> print(IPython.version_info)
(5, 1, 0, '')
from fastprogress.
I can't do anything to fix this without a reproducible example. If you have some code that generates this bug, it would be most helpful.
from fastprogress.
I was just doing lesson 1 of the fast.ai course and got this error.
Even if this example does not reproduce the error for you, considering that self.out may not get initalized in every execution path, wouldn't cheking for self.out not being None before calling a method on it be a good safety measure?
from fastprogress.
Doing lesson 1 of the fastai course is not a reproducible example as it runs completely fine for me and many other people, so there is another reason this fails for you. Adding a check of is not None is just going to make the progress bar not be shown so it's not really a solution.
fastai always beings the iteration of the master bar before adding a child, for some reason, creating the out
attribute silently fails and returns None. What does
from IPython.display import clear_output, display, HTML
out = display(HTML(some_html_code), display_id=True)
do for you?
from fastprogress.
Doing lesson 1 of the fastai course is not a reproducible example as it runs completely fine for me and many other people, so there is another reason this fails for you. Adding a check of is not None is just going to make the progress bar not be shown so it's not really a solution.
fastai always beings the iteration of the master bar before adding a child, for some reason, creating the
out
attribute silently fails and returns None. What doesfrom IPython.display import clear_output, display, HTML out = display(HTML(some_html_code), display_id=True)
do for you?
from fastprogress.
I think problem is with below code, in few cases of "ZMQInteractiveShell" ipython will not generate display_id due to which "out" becomes "None" & later it cannot update. For jupyter notebook it works fine but with cloudera i was facing this issue. So for my case i simply added a check if i am not able to generate display_id isnotebook becomes False which solves my problem.
I am noob here :P so will leave rest on you guys to clear it out.
def isnotebook():
try:
from google import colab
return True
except: pass
try:
shell = get_ipython().__class__.__name__
if shell == 'ZMQInteractiveShell':
##added check here for display_id##
return True # Jupyter notebook, Spyder or qtconsole
elif shell == 'TerminalInteractiveShell':
return False # Terminal running IPython
else:
return False # Other type (?)
except NameError:
return False
from fastprogress.
My experiences match the ones described by tunner007 (which is not surprising considering that our environments also seems to match). Displaying inline HTML works for me fine, both from data.show_batch
(if I work around the downloading part) and also using the example code you pasted. However, out
will be None in your example, which seems to indicate a bug in the environment instead of in fastprogress:
Because the bug seems to be elsewhere, I think you can safely close this issue (unless you see some trivial workaround, which may be worth adding).
Thanks to both of you for helping me find the real culprit.
from fastprogress.
Ok. In this case we can add a test to see if a generated out
becomes None
inside isnotebook
. That way, the progress bar will automatically revert to the console behavior for those enviromnents. Is this what you added @tunner007 ?
from fastprogress.
s this
Yes... for me this solves the problem :)
Note: It seems to be a workaround cuz i was able to run the code but with no progress bar
from fastprogress.
I continued my investigation and found that in the affected environment IPython is rather old:
pip3 freeze | grep ipython
ipython==5.1.0
ipython-genutils==0.2.0
I checked the source code of IPython as of this version and found that unlike recent versions, it does not return a display:
This seems to be the root cause of the problem.
from fastprogress.
Ah ah, in that case a simple test of the ipython version should be enough. Do you know which version starts returning an output?
from fastprogress.
I continued my investigation and found that in the affected environment IPython is rather old:
pip3 freeze | grep ipython ipython==5.1.0 ipython-genutils==0.2.0
I checked the source code of IPython as of this version and found that unlike recent versions, it does not return a display:
This seems to be the root cause of the problem.
Actually i even tried with latest version but faced same problem (versions tested ipython==7.4.0, ipython-7.9.0)
Can you please confirm if upgrading the version works for you ?
from fastprogress.
It was added in this commit, and according to the tags listed at the top, it was first released in 6.0.0.
from fastprogress.
@tunner007 The reason why upgrading doesn't help is that the interactive REPL prompt ignores the user's enviroment for its dependencies, so even after an upgrade it still uses the old version:
> !pip3 freeze | grep ipython ipython==7.9.0 ipython-genutils==0.2.0 > print(IPython.version_info) (5, 1, 0, '')
Got it !
from fastprogress.
Added the test of IPython version, which should solve the issue. Thanks for your help investigating this bug!
from fastprogress.
I'm trying to resume an epoch that was saved by the SaveModelCallback, by using start_epoch=1 but I get this error, Any solutions?
from fastprogress.
Hello, I have run
from IPython.display import clear_output, display, HTML
out = display(HTML('
Testing
'), display_id=True)print('out', out) # here it return None !
from IPython import get_ipython
def isnotebook():
try:
from google import colab
return True
except: pass
try:
shell = get_ipython().class.name
if shell == 'ZMQInteractiveShell':
##added check here for display_id##
return True # Jupyter notebook, Spyder or qtconsole
elif shell == 'TerminalInteractiveShell':
return False # Terminal running IPython
else:
return False # Other type (?)
except NameError:
return False
print(isnotebook()) # and here return True !
I am quite new in this area; so what do I do to solve this problem ?
IPython==7.30.1, the newest one
from fastprogress.
Related Issues (20)
- support PyCharm console as TTY
- force_console_behavior does not modify behavior
- progress bars not displaying in vscode Jupyter notepad HOT 11
- Progress bar not displayed in terminal when using wandb logger HOT 1
- Equivalent of tqdm's desc for Jupyter Notebooks
- typo in readme
- Add Documentation website link to about section HOT 1
- Support for multiple children?
- won't work in spyder? HOT 2
- Keep-Alive-Actions
- Keep-Alive-Actions
- Keep-Alive-Actions
- UserWarning: Couldn't import ipywidgets properly, progress bar will use console behavior HOT 3
- Keep-Alive-Actions
- Keep-Alive-Actions
- Keep-Alive-Actions
- Keep-Alive-Actions
- Misattribution of import errors HOT 1
- Colour of Progress Bar in Jupyter Notebook HOT 1
- Keep-Alive-Actions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastprogress.