jdb78 / pytorch-forecasting

Time series forecasting with PyTorch
https://pytorch-forecasting.readthedocs.io/
MIT License
3.87k stars 611 forks source link

PIXMAP Error #538

Closed paper-cat closed 3 years ago

paper-cat commented 3 years ago

TimeSeriesDataSet( data[lambda x: x['week'] <= training_cutoff], time_idx="week", target="order_cnt", categorical_encoders={"item_code": label_encoder, 'channel': ch_encoder}, group_ids=["item_code", "channel"], time_varying_unknown_reals=["order_cnt"], max_encoder_length=context_length, max_prediction_length=prediction_length, allow_missings=True, )

I run my dataset on nbeats following tutorial, and it runs fine for a whlie, then some error raised,

'Fail to create pixmap with Tk_GetPixmap in TkImgPhotoInstanceSetSize'

or something related with pixmap.

Can I get any advise to solve this problem?

jdb78 commented 3 years ago

Do you have a collab notebook. I am unable to reproduce the error

gbtamas commented 3 years ago

First of all, thanks for the great package!

I have recently started to experiment with the TFT based on the tutorial. Unfortunately, I am experiencing the same error message as described above:

"Fail to create pixmap with Tk_GetPixmap in TkImgPhotoInstanceSetSize"

Interestingly, I face the problem only for large enough max_epochs values. There seems to be a threshold, below which the error cannot be observed and the training runs through without any problem. However, if max_epochs is large enough, the training stops after a while and the aforementioned error is raised.

jdb78 commented 3 years ago

I guess there is a memory / buffer issue within related to matplotlib - probably as the memory is not released correctly.

paper-cat commented 3 years ago

For me, it was matplotlib issue, not pytorch-forecasting.

Just add a line of code at top,

matplotlib.use("Agg")

It works for me.

(Actually, I forgot to leave a comment, sorry for late comment)