小编dal*_*nsi的帖子

Matplotlib/Seaborn:自 3.3 起已弃用将非整数作为三元素位置规范传递

我不明白这个错误消息:

MatplotlibDeprecationWarning: Passing non-integers as three-element position specification is deprecated since 3.3 and will be removed two minor releases later.

你能给我一个提示吗?

仅供参考,我的(不可执行)代码如下

import seaborn as sns
import matplotlib.pyplot as plt

for p in ps:
    p_metrics = output_metrics.loc[output_metrics["p"] == p, :]
    g = sns.relplot(x="k", y="metric_value", col="metric_name", hue="ref/eval", style="ref/eval",
                    col_wrap=np.ceil(np.sqrt(len(metrics))), palette="muted", kind="line",
                    dashes=False, legend="full", facet_kws={"sharex": False, "sharey": False},
                    data=p_metrics, markers=self.filled_markers)

    g.savefig(f"plot_cat1_p={p}.png")
    if show:
        plt.show()
Run Code Online (Sandbox Code Playgroud)

matplotlib seaborn python-3.6

4
推荐指数
1
解决办法
3899
查看次数

如何使用 Hydra-fb 将配置文件收集到列表中?

假设我的代码中有一个抽象类,db并且类, , ...继承自。\n我的项目使用Hydra并具有以下结构:db1db1db1db

\n
\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 my_app.py\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 conf.yaml\n\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 db\n    \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 db1.yaml\n    \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 db2.yaml\n    \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 db3.yaml\n
Run Code Online (Sandbox Code Playgroud)\n

我需要一个列表,db所以我想得到一个最终的配置文件,如下所示:

\n
\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 my_app.py\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 conf.yaml\n\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 db\n    \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 db1.yaml\n    \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 db2.yaml\n    \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 db3.yaml\n
Run Code Online (Sandbox Code Playgroud)\n

所以这是, , .\n在文件中db的参数列表,我想像这样:db1db2db3conf.yaml

\n
db:\n  -\n    param1_of_db1: key_1_1\n    param2_of_db1: key_1_2\n  -\n    param1_of_db2: key_2_1\n    param2_of_db2: key_2_2\n  -\n    param1_of_db3: key_3_1\n    param2_of_db3: key_3_2\n
Run Code Online (Sandbox Code Playgroud)\n

有没有办法做类似的事情?

\n

python fb-hydra

3
推荐指数
1
解决办法
3475
查看次数

标签 统计

fb-hydra ×1

matplotlib ×1

python ×1

python-3.6 ×1

seaborn ×1