pytorch-ts icon indicating copy to clipboard operation
pytorch-ts copied to clipboard

TypeError: __init__() got an unexpected keyword argument 'freq'

Open hanlaoshi opened this issue 2 years ago • 6 comments

Hi, Training is well when I reproduce the tests, but in forecasting, I encountered an issue. Here are some specifics. (the version of packages: pytorchts-0.6.0, gluonts-0.10.0)

/home/axx/anaconda3/envs/torch2/lib/python3.8/site-packages/gluonts/dataset/multivariate_grouper.py:191: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray. return {FieldName.TARGET: np.array([funcs(data) for data in dataset])} 100%|███████████████████████████████████████████████████████| 99/99 [15:13<00:00, 9.23s/it, epoch=1/1, avg_loss=-64.6] Traceback (most recent call last): File "Multivariate-Flow-Solar.py", line 202, in predictor = estimator.train(dataset_train) #input_name: File "/home/axx/anaconda3/envs/torch2/lib/python3.8/site-packages/pts/model/estimator.py", line 179, in train return self.train_model( File "/home/aixx/anaconda3/envs/torch2/lib/python3.8/site-packages/pts/model/estimator.py", line 160, in train_model predictor=self.create_predictor( File "/home/axx/anaconda3/envs/torch2/lib/python3.8/site-packages/pts/model/tempflow/tempflow_estimator.py", line 244, in create_predictor return PyTorchPredictor( TypeError: init() got an unexpected keyword argument 'freq'

When everyone faces the same problem, any assistance is greatly appreciated.

hanlaoshi avatar Nov 07 '22 10:11 hanlaoshi

Can you kindly downgrade gluonts as I have not updated this lib. to use the new APIs etc.

kashif avatar Nov 07 '22 10:11 kashif

@kashif Thank you very much for your generous answers. Downgrading gluons from 0.10.0 to 0.9 works for me. By the way, if you downgrade your gluonts to 0.9, don't forget to change the file of ditribution_out.py in line 34(i.e. gluonts.torch.distributions.distribution_output-->gluonts.torch.modules.distribution_output)

hanlaoshi avatar Nov 07 '22 13:11 hanlaoshi

Hi, @kashif, I sent you an email late last night, and I would appreciate it if you could find some time in your hectic work schedule to respond. Your study is really great, and I'll be basing my own scientific research on it!

hanlaoshi avatar Nov 07 '22 13:11 hanlaoshi

Hi, @kashif Does the implementation of this code not use the multi-scale structure like the one in the Real-NVP paper?

hanlaoshi avatar Dec 07 '22 07:12 hanlaoshi

@hanlaoshi not sure if i understand, but what do you mean by " multi-scale structure" exactly? thanks!

kashif avatar Dec 07 '22 18:12 kashif

@kashif Sorry, I didn't make it clear. Actually, in the original article introducing the Real-NVP, "Multi-scale architecture" means factoring out half of the dimensions at regular intervals. So, it can define this operation recursively as below: image

hanlaoshi avatar Dec 08 '22 02:12 hanlaoshi