-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
progress bars not displaying in vscode Jupyter notepad #104
Comments
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. |
@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. |
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 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() |
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)] |
Same issue here - no progress bars in vscode :( |
Ok, I tried a few different versions of the Jupyter extension and: |
@bosmart thanks for the effort there, I hadn't been aware it was so easy to revert extension versions in vscode now. |
@codermrrob I've opened the following: microsoft/vscode-jupyter#13163 |
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 Here is my code snippet (I only inserted some # 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... |
Another workaround from an older issue, forcing text output for the progress bar:
|
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: |
A few days ago fastprogress stopped working in Jupyter notepads in vscode.
It seems to run without error but does not display anything.
I have the same issue in existing environments (venv) and in newly created environments.
I have reverted to Jan 2023 version of vscode where I know it was working before, but that showed no change.
Running the following code works for console output, but in Jupyter notebook nothing.
Where should I look to try and resolve this issue? Any guidance will be valuable because I have pretty much exhausted my knowledge of fastprogress and what I can do.
The text was updated successfully, but these errors were encountered: