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

Multivariate-Flow-Solar:an error is reported when flow_type='MAF' #150

Open
c247274901 opened this issue Oct 19, 2023 · 1 comment
Open

Comments

@c247274901
Copy link

Thank you for visiting my issue!
I'm using my own dataset,dim=1:

estimator = TempFlowEstimator(
    freq=custom_ds_metadata["freq"], 
    prediction_length=custom_ds_metadata["prediction_length"],
    target_dim=dim,
    cell_type='GRU',
    input_size=6,
    scaling=True,
    dequantize=True,
    flow_type='MAF',
    trainer=Trainer(device=device,
                    epochs=20,
                    learning_rate=1e-4,
                    num_batches_per_epoch=20,
                    batch_size=256)
)

train_output = estimator.train_model(training)
predictor = train_output.predictor

Error message or code output

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_12548\2258705580.py in <module>
     16 )
     17 
---> 18 train_output = estimator.train_model(training)
     19 predictor = train_output.predictor

~\Downloads\pytorch-ts-master\pytorch-ts-master\pts\model\estimator.py in train_model(self, training_data, validation_data, num_workers, prefetch_factor, shuffle_buffer_length, cache_data, **kwargs)
    101         transformation = self.create_transformation()
    102 
--> 103         trained_net = self.create_training_network(self.trainer.device)
    104 
    105         input_names = get_module_forward_input_names(trained_net)

~\Downloads\pytorch-ts-master\pytorch-ts-master\pts\model\tempflow\tempflow_estimator.py in create_training_network(self, device)
    206             n_hidden=self.n_hidden,
    207             conditioning_length=self.conditioning_length,
--> 208             dequantize=self.dequantize,
    209         ).to(device)
    210 

c:\users\pc\appdata\local\programs\python\python37\lib\site-packages\gluonts\core\component.py in init_wrapper(*args, **kwargs)
    342                 self.__class__.__repr__ = validated_repr
    343 
--> 344             return init(self, **all_args)
    345 
    346         # attach the Pydantic model as the attribute of the initializer wrapper

~\Downloads\pytorch-ts-master\pytorch-ts-master\pts\model\tempflow\tempflow_network.py in __init__(self, input_size, num_layers, num_cells, cell_type, history_length, context_length, prediction_length, dropout_rate, lags_seq, target_dim, conditioning_length, flow_type, n_blocks, hidden_size, n_hidden, dequantize, cardinality, embedding_dimension, scaling, **kwargs)
     65             n_hidden=n_hidden,
     66             hidden_size=hidden_size,
---> 67             cond_label_size=conditioning_length,
     68         )
     69         self.dequantize = dequantize

~\Downloads\pytorch-ts-master\pytorch-ts-master\pts\modules\flows.py in __init__(self, n_blocks, input_size, hidden_size, n_hidden, cond_label_size, activation, input_order, batch_norm)
    405                     activation,
    406                     input_order,
--> 407                     self.input_degrees,
    408                 )
    409             ]

~\Downloads\pytorch-ts-master\pytorch-ts-master\pts\modules\flows.py in __init__(self, input_size, hidden_size, n_hidden, cond_label_size, activation, input_order, input_degrees)
    250         # create masks
    251         masks, self.input_degrees = create_masks(
--> 252             input_size, hidden_size, n_hidden, input_order, input_degrees
    253         )
    254 

~\Downloads\pytorch-ts-master\pytorch-ts-master\pts\modules\flows.py in create_masks(input_size, hidden_size, n_hidden, input_order, input_degrees)
     22         )
     23         for _ in range(n_hidden + 1):
---> 24             degrees += [torch.arange(hidden_size) % (input_size - 1)]
     25         degrees += (
     26             [torch.arange(input_size) % input_size - 1]

RuntimeError: ZeroDivisionError

Environment

Python version: 3.7.0
GluonTS version: 0.9.0
MXNet version: without MXNet

@c247274901
Copy link
Author

when flow_type=‘RealNVP’,there is no problem.

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