Comments (11)
@elisgrahn I also reverted ipywidgets, but I can verify both the ipywidgets 7.7.* and 8 work fine; I can import and run and successfully display widgets in notebooks that I have tried. fastprogress is working in console mode, of course, but not in notebooks in vscode.
makes working through the fastai courses problematic with local setup, which is disappointing because I want to utilize my GPU (which I have successfully set up, which is the trickier part). But now I've hit this wall.
from fastprogress.
Same issue here. Just started with the course and was wondering why I don't get any output. I played around and found out that with a short sleep between the display.update()
calls in the show
method of the progress bar it actually outputs something. Might be a race condition somewhere.
Here is my code snippet (I only inserted some time.sleep()
, the rest is basically unchanged):
# workaround for displaying progress bar in notebook
import time
from fastai.vision.all import *
from fastprogress.fastprogress import NBMasterBar, NBProgressBar
class NBMasterBarPatched(NBMasterBar):
def on_iter_begin(self):
super().on_iter_begin()
time.sleep(0.01)
def show(self):
time.sleep(0.01)
super().show()
class NBProgressBarPatched(NBProgressBar):
def on_iter_begin(self):
super().on_iter_begin()
time.sleep(0.01)
def show(self):
time.sleep(0.01)
super().show()
class ProgressCallbackPatched(ProgressCallback):
def before_fit(self):
if self.create_mbar: self.mbar = NBMasterBarPatched(list(range(self.n_epoch)))
assert hasattr(self.learn, 'recorder')
if self.learn.logger != noop:
self.old_logger,self.learn.logger = self.logger,self._write_stats
self._write_stats(self.recorder.metric_names)
else: self.old_logger = noop
def _launch_pbar(self):
self.pbar = NBProgressBarPatched(self.dl, parent=getattr(self, 'mbar', None), leave=False)
self.pbar.update(0)
defaults.callbacks = [TrainEvalCallback, Recorder, ProgressCallbackPatched]
# now do your learning
learn...
from fastprogress.
I have the exact same problem. Discovered something was wrong since fastai wasn't displaying any bars. Tqdm for instance, still works in notebooks.
I have also tried to revert to Jan 2023 vscode and also reverted ipywidgets to 7.7.* instead of 8 without any further luck.
from fastprogress.
Also having this issue. In the meantime, if anyone like myself is still early in the learning process and just needs the epoch data, there is a quick workaround. Add cbs=CSVLogger()
to your learner, and then create a quick function to display it. Example:
def train_res():
train_data = pd.read_csv('history.csv')
return train_data.head(n=50)
learn = tabular_learner(dls, layers=[500, 250], n_out=1, y_range=(-11,11), loss_func=F.mse_loss, cbs=CSVLogger())
learn.fit_one_cycle(1, 1e-2)
train_res()
from fastprogress.
Nice workaround! Just want to share that the solution I've currently settled on is to add a TensorBoardCallback() in order to view the models in Tensorboard. Might be a bit overkill, but I felt it was useful to learn how to use it.
cbs=[TensorBoardCallback(n_preds=8)]
from fastprogress.
Same issue here - no progress bars in vscode :(
from fastprogress.
Ok, I tried a few different versions of the Jupyter extension and:
v2022.11.1003412109 - working, ShowGraphCallback works too
v2023.1.2000312134 - working, ShowGraphCallback doesn’t (plot disappears)
v2023.1.2010391206 - working, ShowGraphCallback doesn’t (plot disappears)
v2023.2.1000592019 - not working, ShowGraphCallback works again
v2023.2.1200692131 - not working, ShowGraphCallback works again
from fastprogress.
@bosmart thanks for the effort there, I hadn't been aware it was so easy to revert extension versions in vscode now.
from fastprogress.
@codermrrob I've opened the following: microsoft/vscode-jupyter#13163
from fastprogress.
Another workaround from an older issue, forcing text output for the progress bar:
from fastprogress.fastprogress import master_bar, progress_bar
from fastprogress.fastprogress import force_console_behavior
master_bar, progress_bar = force_console_behavior()
from fastprogress.
Same issue here. Reverted jupyter extension and it seems to be working. I'll add a comment to the vs-code jupyter issue as well.
EDIT:
Should have looked at the jupyter issue first. Looks like it was merged two days ago. Guessing we'll see it in the next release.
from fastprogress.
Related Issues (20)
- support PyCharm console as TTY
- force_console_behavior does not modify behavior
- How to disable or turn-off progress bar globally HOT 1
- Progress bar not clearing line in Console mode
- is there any way to add grid or ticks?
- 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.