Open jambudipa opened 1 year ago
I have this problem too!
Is it possible to install from GitHub?
I also have this problem.
I had this problem too. Didn't find a solution, so I looked into where the import is called:
For me that waspytorch_forecasting\models\deepar\__init__.py
line 13.
The import is not used in the file, so I just deleted the line.
I had the same problem. I solved the issue by applying the method mentioned by Coopez. It worked for me.
I have same problem, I found some solutions to the problem.
Recommend: First, PyTorch-Forecasting does not support python3.11, please install python3.8-3.10. Second, if your lightning
or pytorch lightning
is 2.0 or above, please Update to pytorch-forecasting 1.0.0
(use pip install pytorch-forecasting
, conda install
is still version 0.10.2). Anyway, please make sure that the python version is within 3.10, and that only pytorch-forecasting 1.0 supports lightning 2.0.
Other way: There may be some problems
from pytorch_lightning.core.module import LightningModule
, because pytorch_lightning 2.0 seems to have replaced the core.lightning
with core.module
The solution suggested by @havanoname (i.e., downgrading to python version 3.10
) and using pytorch lightning
installed with pip
) worked for me. Post the downgrade to a conda environment with python version 3.10
(with pytorch installed) all I had to do was install the pytorch-forecasting
library with pip
and the tutorials in pytorch-forecasting
seemed to start working (i.e., I was no longer facing the pytorch lightning errors).
I have same problem, I found some solutions to the problem. Recommend: First, PyTorch-Forecasting does not support python3.11, please install python3.8-3.10. Second, if your
lightning
orpytorch lightning
is 2.0 or above, please Update topytorch-forecasting 1.0.0
(usepip install pytorch-forecasting
,conda install
is still version 0.10.2). Anyway, please make sure that the python version is within 3.10, and that only pytorch-forecasting 1.0 supports lightning 2.0.Other way: There may be some problems
- As @Coopez said, deleted the line, but maybe this module will be used later.
- Replace this line with:
from pytorch_lightning.core.module import LightningModule
, because pytorch_lightning 2.0 seems to have replaced thecore.lightning
withcore.module
This also works on my case
same problem.
pytorch-forecasting 1.0.0 pytorch-lightning 2.0.0 pytorch_optimizer 2.12.0 torch 2.1.1 torchmetrics 1.2.0 Above are torch versions installed in my conda env. with python 3.8.18. I am getting below error while trying to set up https://pytorch-forecasting.readthedocs.io/en/stable/tutorials/stallion.html in my Anaconda Env in Mac ImportError: cannot import name 'Prediction' from 'pytorch_forecasting.models.base_model' error. I am a beginner in python. looking forward for help.
With conda, pytorch-forecasting is not updated, use pip install pytorch-forecasting. I had to then also install fastparquet and pyarrow with conda, and now it works :)
I have same problem, I found some solutions to the problem. Recommend: First, PyTorch-Forecasting does not support python3.11, please install python3.8-3.10. Second, if your
lightning
orpytorch lightning
is 2.0 or above, please Update topytorch-forecasting 1.0.0
(usepip install pytorch-forecasting
,conda install
is still version 0.10.2). Anyway, please make sure that the python version is within 3.10, and that only pytorch-forecasting 1.0 supports lightning 2.0.Other way: There may be some problems
- As @Coopez said, deleted the line, but maybe this module will be used later.
- Replace this line with:
from pytorch_lightning.core.module import LightningModule
, because pytorch_lightning 2.0 seems to have replaced thecore.lightning
withcore.module
Great suggestion. I followed the instructions after creation of a virtual environment with python 3.10.0 and it worked just perfect. Thanks.
建议使用python 3.8 pytorch_lightning 建议降级处理,我成功的解决了这个问题,就是通过不断的尝试安装更低的版本。比如pytorch_lightning==1.3.8 或者是pytorch_lightning==2.1
Expected behavior
I expect my code to compile, but I get an error.
Actual behavior
I get the error:
I installed using the
conda
command on the home page of GitHub:...although I had to remove the
>=1.7
because it told me that was a syntax error.The error is thrown in
anaconda3/envs/pytorch/lib/python3.11/site-packages/pytorch_forecasting/models/deepar/__init__.py
, and it seems my version of the code does not in any way correspond to what is in the repo, starting instead like this:I must tell you that I am a Python newbie 😇 although 42 years of programming experience!
How do I pull the code in the right way??