Skip to content
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

Can not use TSTPLUS with MVP #747

Open
jiangye-git opened this issue Apr 23, 2023 · 2 comments
Open

Can not use TSTPLUS with MVP #747

jiangye-git opened this issue Apr 23, 2023 · 2 comments

Comments

@jiangye-git
Copy link

Unlabeled 100%

print("Unlabeled 100%")
dsid = "transformer"
learn = ts_learner(udls100, TSTPlus, cbs=[MVP(target_dir='./data/MVP', fname=f'{dsid}_200')])
learn.fit_one_cycle(40,1e-2)
learn.plot_metrics()
learn.MVP.show_preds(sharey=True)
learn.feature_importance()

Traceback (most recent call last):
File "H:\20221125\tasi\tsbert.py", line 106, in
learn.fit_one_cycle(40,1e-2)
File "F:\ProgramData\Anaconda3\envs\pytorchjy\lib\site-packages\fastai\callback\schedule.py", line 119, in fit_one_cycle
self.fit(n_epoch, cbs=ParamScheduler(scheds)+L(cbs), reset_opt=reset_opt, wd=wd, start_epoch=start_epoch)
File "F:\ProgramData\Anaconda3\envs\pytorchjy\lib\site-packages\fastai\learner.py", line 256, in fit
self._with_events(self._do_fit, 'fit', CancelFitException, self._end_cleanup)
File "F:\ProgramData\Anaconda3\envs\pytorchjy\lib\site-packages\fastai\learner.py", line 193, in with_events
try: self(f'before
{event_type}'); f()
File "F:\ProgramData\Anaconda3\envs\pytorchjy\lib\site-packages\fastai\learner.py", line 171, in call
def call(self, event_name): L(event_name).map(self._call_one)
File "F:\ProgramData\Anaconda3\envs\pytorchjy\lib\site-packages\fastcore\foundation.py", line 156, in map
def map(self, f, *args, gen=False, **kwargs): return self._new(map_ex(self, f, *args, gen=gen, **kwargs))
File "F:\ProgramData\Anaconda3\envs\pytorchjy\lib\site-packages\fastcore\basics.py", line 840, in map_ex
return list(res)
File "F:\ProgramData\Anaconda3\envs\pytorchjy\lib\site-packages\fastcore\basics.py", line 825, in call
return self.func(*fargs, **kwargs)
File "F:\ProgramData\Anaconda3\envs\pytorchjy\lib\site-packages\fastai\learner.py", line 175, in _call_one
for cb in self.cbs.sorted('order'): cb(event_name)
File "F:\ProgramData\Anaconda3\envs\pytorchjy\lib\site-packages\fastai\callback\core.py", line 62, in call
except Exception as e: raise modify_exception(e, f'Exception occured in {self.__class__.__name__} when calling event {event_name}:\n\t{e.args[0]}', replace=True)
File "F:\ProgramData\Anaconda3\envs\pytorchjy\lib\site-packages\fastai\callback\core.py", line 60, in call
try: res = getcallable(self, event_name)()
File "F:\ProgramData\Anaconda3\envs\pytorchjy\lib\site-packages\tsai\callback\MVP.py", line 183, in before_fit
assert xb.shape == self.learn.model(xb).shape, 'the model cannot reproduce the input shape'
AssertionError: Exception occured in MVP when calling event before_fit:
the model cannot reproduce the input shape

HELP!!!!!

@jiangye-git
Copy link
Author

udls100 = get_ts_dls(X, splits=splits, tfms=tfms, batch_tfms=batch_tfms) # used in pretraining

X.shape:(66, 4, 1800)

@jiangye-git
Copy link
Author

I have no idea what's wrong TT I just replace the inceptiontimeplus in the TSBERT example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant