简体   繁体   English

许多与 Glunts 的兼容性问题

[英]Many compatibility problems with gluonts

I would like to install the gluonts package.我想安装 Gluonts package。 The problem here is that there are extremely many compatibility issues.这里的问题是兼容性问题非常多。 I cannot manually solve each of these compatibility problems by trial and error.我无法通过反复试验手动解决这些兼容性问题。 Is there a general way to solve the whole thing automatically?有没有一种通用的方法可以自动解决整个问题?

I am working in the PyCharm environment with Pyton.我正在使用 Pyton 在 PyCharm 环境中工作。 to use a virtual environment I am using Anaconda.使用虚拟环境我使用的是 Anaconda。

The packages I need in any case are Jupyter, Numpy, Pandas, mxnet, matplotlib and just glounts.在任何情况下我都需要的软件包是 Jupyter、Numpy、Pandas、mxnet、matplotlib 和只是 glounts。

I have also tried to install the whole thing in a different order, that didn't work either, so I installed gluonts first, which also worked, but when I then wanted to install mxnet is then the problem.我还尝试以不同的顺序安装整个东西,但也没有用,所以我先安装了 gluonts,这也有效,但是当我想安装 mxnet 时,问题就来了。 Since I'm writing my bachelor thesis and accordingly under time pressure, I would be very grateful for your help.由于我正在写我的学士论文,因此在时间压力下,我将非常感谢您的帮助。

My plan is to implement the whole thing in Pyton 3.6, I've also tried switching to Pyton 3.7, but that didn't help either.我的计划是在 Pyton 3.6 中实现整个事情,我也尝试过切换到 Pyton 3.7,但这也没有帮助。 Now I will try it with Python 3.5.现在我将尝试使用 Python 3.5。

When solving the problem, it should be noted that I am not completely free in my way of working, since I work on a unicomputer and do not have all the rights, etc. EDIT So I have now found a solution myself, how to use everything reasonably.解决问题的时候要注意,我的工作方式并不是完全自由的,因为我是在单机上工作的,没有所有的权限等等。编辑所以我现在自己找到了解决方案,如何使用一切合理。 You create with anaconda prompt a new environment and use there Python 3.9, when creating give the following code conda create -n env python=3.9 numpy=1.16.6 conda activate env pip install mxnet gluonts jupyter conda deactivate You create with anaconda prompt a new environment and use there Python 3.9, when creating give the following code conda create -n env python=3.9 numpy=1.16.6 conda activate env pip install mxnet gluonts jupyter conda deactivate

now you could select this as normal environment in PyCharm.现在您可以将 select 作为 PyCharm 中的正常环境。 You could also look at the whole thing normally in the anaconda navigator and see which packages you have on it.您也可以在 anaconda 导航器中正常查看整个内容,并查看上面有哪些包。

The general form is:一般形式为:

pip install gluonts

You should try this:你应该试试这个:

# support for mxnet models, faster datasets
pip install gluonts[mxnet,pro]  

# support for torch models, faster datasets
pip install gluonts[torch,pro]

and then try this example:然后试试这个例子:

from gluonts.dataset.util import to_pandas
from gluonts.dataset.pandas import PandasDataset
from gluonts.dataset.repository.datasets import get_dataset
from gluonts.model.deepar import DeepAREstimator
from gluonts.mx import Trainer

dataset = get_dataset("airpassengers")

deepar = DeepAREstimator(prediction_length=12, freq="M", trainer=Trainer(epochs=5))
model = deepar.train(dataset.train)

# Make predictions
true_values = to_pandas(list(dataset.test)[0])
true_values.to_timestamp().plot(color="k")

prediction_input = PandasDataset([true_values[:-36], true_values[:-24], true_values[:-12]])
predictions = model.predict(prediction_input)

for color, prediction in zip(["green", "blue", "purple"], predictions):
    prediction.plot(color=f"tab:{color}")

plt.legend(["True values"], loc="upper left", fontsize="xx-large")

Here is the link to the gluonts 0.10.2 module:这是 Gluonts 0.10.2 模块的链接:

https://pypi.org/project/gluonts/ https://pypi.org/project/gluonts/

Please state any errors that you see with this.请 state 您看到的任何错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM