-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Exception occured in ProgressCallback
when calling event after_batch
- preventing from running even the basic fastai tutorials
#3809
Comments
ProgressCallback
when calling event after_batch
- preventing from running even the basic fastai tutorials
Fixed by adding |
I had the same problem with fastai 2.7.9, fastcore 1.5.27, PyTorch 1.13.0 on macOS Ventura 13.0. The problem is caused by this:
The
It can be fixed by extracting the value of
Hacking site-packages/fastai/callback/progress.py with this change fixed the problem. |
* fastai: Remove ProgressCallback in tests. Per fastai/fastai#3809 * pin PytTorch version. Per pytorch/pytorch#85427
Looks like this is a regression from the following pytorch commit:
However, an additional check was added, preventing this path from being exercised for instances of subclasses of
|
Sounds like this is an underlying pytorch issue, is there an open bug or PR on pytorch anyone is aware of? I just picked up fastai the other day and ran face first into this. The |
There's an existing pytorch issue for this here: |
A workaround for this has been merged: #3828 |
Be sure you've searched the forums for the error message you received. Also, unless you're an experienced fastai developer, first ask on the forums to see if someone else has seen a similar issue already and knows how to solve it. Only file a bug report here when you're quite confident it's not an issue with your local setup.
Please see this model example of how to fill out an issue correctly. Please try to emulate that example as appropriate when opening an issue.
Please confirm you have the latest versions of fastai, fastcore, and nbdev prior to reporting a bug (delete one): YES
fastai version = '2.7.9'
fastcore version = '1.5.27'
torch version = '1.13.0.dev20220928'
Cuda version = 11.7
Running on Windows 11 pro wsl2
Describe the bug
When trying the basic cat vs dog classification, gets following error after learn.fine_tune(1)
TypeError: Exception occured in
ProgressCallback
when calling eventafter_batch
:unsupported format string passed to TensorBase.format
To Reproduce
Steps to reproduce the behavior:
`from fastai.vision.all import *
path = untar_data(URLs.PETS)/'images'
def is_cat(x): return x[0].isupper()
dls = ImageDataLoaders.from_name_func(
path, get_image_files(path), valid_pct=0.2, seed=42,
label_func=is_cat, num_workers=0, device ="cuda", item_tfms=Resize(224))
learn = vision_learner(dls, resnet34, metrics=error_rate)
learn.fine_tune(1)`
see notebook at for full details https://github.com/prePhilip/fastaitest/blob/main/test.ipynb
Expected behavior
A clear and concise description of what you expected to happen.
learn.fine tune proceeds without any error
Error with full stack trace
Place between these lines with triple backticks:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: