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
xresnet for vision classification - TypeError #728
Comments
Thanks for sharing this @JakobPuehringer. |
@oguiza no worries, glad to help |
Also, I tested the workflow again and the initial bug does not occur anymore, but another error gets thrown.
this results in the following error:
Is it not intended to use xresnet models here? |
Hi @JakobPuehringer, from tsai.basics import *
from tsai.data.image import TSToPlot
from tsai.models.utils import create_model
from fastai.vision.models.xresnet import xresnet34
X = np.random.rand(8, 3, 100)
y = np.random.randint(0, 3, (8))
splits = TimeSplitter()(y)
tfms = [None, TSCategorize()]
batch_tfms = [TSNormalize(), TSToPlot()]
learn = TSClassifier(X, y, splits=splits, tfms=tfms, bs=[64, 128], batch_tfms=batch_tfms, arch=xresnet34, metrics=accuracy)
learn.fit_one_cycle(1) It'd be good if you could test it with your own code and confirm it works as expected. |
Hi @oguiza! |
I try to follow the 06_TS_to_image_classification notebook on the latest version of tsai and the following dataset specs:
Running the following line, results in a TypeError:
learn = TSClassifier(X, y, splits=splits, bs=[2, 2], tfms=[None, Categorize()], batch_tfms=[TSNormalize(), TSToPlot()], arch=xresnet34, metrics=accuracy)
Error:
After some digging into the source code (still a newbie to tsai), I discovered that the fastai model xresnet34() expects the parameter n_out, instead of c_out. The latest update in notebook nbs/030_models.utils.ipynb makes some changes to create xresnet models, so this could probably have to do something with it.
Setup:
python : 3.9.16
tsai : 0.3.6
fastai : 2.7.11
fastcore : 1.5.28
torch : 1.13.1+cu117
The text was updated successfully, but these errors were encountered: