timeseriesAI / tsai

Time series Timeseries Deep Learning Machine Learning Python Pytorch fastai | State-of-the-art Deep Learning library for Time Series and Sequences in Pytorch / fastai
https://timeseriesai.github.io/tsai/
Apache License 2.0
4.95k stars 625 forks source link

bug when following guidance of PatchTST #774

Closed Valhir924 closed 1 year ago

Valhir924 commented 1 year ago

While I was trying to follow the ipynb of PatchTST with MyDataset, I meet the following error.

AttributeError: Exception occured in ShowGraph when calling event after_epoch: 'NoneType' object has no attribute 'update'

in codes : learn.fit_one_cycle(n_epochs, lr_max=lr_max)

I used ShowGraph above like this : learn = TSForecaster(X, y, splits=V2_splits_1, batch_size=16, path="models", arch="PatchTST", arch_config=arch_config, metrics=[mae], cbs=[ShowGraph()])

When I was using another virtual env, the error message became :

NameError: Exception occured in ShowGraph when calling event after_epoch: name 'display' is not defined

I'm confused. Glad if anyone offers a hand.

Valhir924 commented 1 year ago

Oh I've noticed an issue similar to this one and I've found out the 'ShowGraph' callback problem. It's fixed now.

makinno commented 11 months ago

Hello @Valhir924, I encountered the same error like you when training TSTPlus model on my dataset AttributeError: Exception occured in ShowGraph when calling event after_epoch: 'NoneType' object has no attribute 'update' Please can you explain how you fixed the error?

Valhir924 commented 11 months ago

Hello @makinno. To be honest, I cannot recall the details clearly, so I searched the issue again and found it successfully. Due to the use of the ShowGraph callback, when running a script, there's no printed graph. It tries to update it, which cannot be found and fails. My solution was to remove the callback, since I actually didn't need it. You can pick your own. The primary issue is #116. Though the error reporting is not completely consistent. It shares the reason. : )

makinno commented 11 months ago

Alright, thank you for your fast response!