Open Mr-kunyuan opened 1 month ago
I got the same problem, did you solve it?
我遇到了同样的问题,你解决了吗?
It hasn't been solved yet.
我遇到了同样的问题,你解决了吗?
It hasn't been solved yet.
I solved this problem by modifying this file: .../site-packages/gluonts/torch/model/predictor.py just ignore the exception by the code below
try:
with torch.no_grad():
yield from self.forecast_generator(
inference_data_loader=inference_data_loader,
prediction_net=self.prediction_net,
input_names=self.input_names,
output_transform=self.output_transform,
num_samples=num_samples,
)
except :
pass
and it worked.
我遇到了同样的问题,你解决了吗?
It hasn't been solved yet.
I solved this problem by modifying this file: .../site-packages/gluonts/torch/model/predictor.py just ignore the exception by the code below
try: with torch.no_grad(): yield from self.forecast_generator( inference_data_loader=inference_data_loader, prediction_net=self.prediction_net, input_names=self.input_names, output_transform=self.output_transform, num_samples=num_samples, ) except : pass
and it worked.
It worked. Thank you.
I ran into this too. My fix is ...
In .../site-packages/torch/autograd/grad_mode.py
, add the following if
at line 84:
Describe the bug I encountered the following problem when running the sample program "Loading weights from local directory Exception ignored in: <generator object PyTorchPredictor.predict at 0x7fe3a1d23a40> Traceback (most recent call last): The File "/ root/miniconda3 / lib/python3.12 / site - packages/gluonts/torch/model/predictor. Py", line 89, in predict The File "/ root/miniconda3 / lib/python3.12 / site - packages/torch/autograd/grad_mode py", line 84, in exit TypeError: 'NoneType' object is not callable '. How to solve it?
Environment Python version: 3.12.2 PyTorch version: 2.3.1+cu118