Skip to content

Issue with get_lagllama_predictions #133

Description

@DhruvModi1605

I'm experiencing below issue while running :

forecasts, tss = get_lag_llama_predictions(backtest_dataset, prediction_length, device, num_samples)

Note:

I faced issue with GLuonts. Hence, I executed:
pip install -U gluonts after installing packages from requirements.txt.

Error: 

UnpicklingError                           Traceback (most recent call last)
<ipython-input-35-36138b0f98ee> in <cell line: 0>()
      7   trd = df.iloc[start: end]
      8   dataset_train = PandasDataset.from_long_dataframe(trd, target="y", item_id="unique_id")
----> 9   forecasts, tss = get_lag_llama_predictions(
     10       dataset_train,
     11       prediction_length=prediction_length,

1 frames
/usr/local/lib/python3.11/dist-packages/torch/serialization.py in load(f, map_location, pickle_module, weights_only, mmap, **pickle_load_args)
   1468                         )
   1469                     except pickle.UnpicklingError as e:
-> 1470                         raise pickle.UnpicklingError(_get_wo_message(str(e))) from None
   1471                 return _load(
   1472                     opened_zipfile,

UnpicklingError: Weights only load failed. This file can still be loaded, to do so you have two options, do those steps only if you trust the source of the checkpoint. 
	(1) In PyTorch 2.6, we changed the default value of the weights_only argument in torch.load from False to True. Re-running torch.load with weights_only set to False will likely succeed, but it can result in arbitrary code execution. Do it only if you got the file from a trusted source.
	(2) Alternatively, to load with weights_only=True please check the recommended steps in the following error message.
	WeightsUnpickler error: Unsupported global: GLOBAL gluonts.torch.distributions.studentT.StudentTOutput was not an allowed global by default. Please use torch.serialization.add_safe_globals([StudentTOutput]) or the torch.serialization.safe_globals([StudentTOutput]) context manager to allowlist this global if you trust this class/function.

Check the documentation of torch.load to learn more about types accepted by default with weights_only https://pytorch.org/docs/stable/generated/torch.load.html.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions